Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
BlackBerry Employee
jingmeifan
Posts: 1
Registered: ‎11-30-2010
My Device: Not Specified
Accepted Solution

How to play mp3 in tablet simulator

I want to embed sound to app, the code snippet as following:

 

 

if (Capabilities.hasMP3) {
  _sound = new Sound();
  _sound.load(new URLRequest("xxx.mp3"));
  _sound.play();
 }else {
  var noPlayButton:LabelButton = new LabelButton();
  noPlayButton.label = "No MP3";
  noPlayButton.x = (stage.stageWidth - noPlayButton.width)/2;
  noPlayButton.y = (stage.stageHeight - noPlayButton.height)/2;
  addChild(noPlayButton);
 }

 

The mp3 file is in the same folder as .as file, and it can play when I run the app on desktop ; however, there is no sound if the app is run on simulator, and there is no "No MP3" button either. I checked the Sound Card is Auto detect, Connected is checking on.....

 

Any idea what should be setup? or how should change the code?

 

Thanks,

Jane

 

 

 

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: How to play mp3 in tablet simulator

Sound/speakers in the simulator do not currently work.  Hope to have that in the next SDK release.  If it works as an AIR application, you're probbly safe to assume it will work on the final device.

Please use plain text.