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
New Developer
Posts: 28
Registered: ‎11-23-2010
My Device: playbook
My Carrier: none

how to use sound files

Hi,

 

I need your help regarding sound files.

I've put some mp3 files in several parts of the code.

To do that I've copied the files to the folder - \Adobe Flash Builder Burrito Preview\<project name>\src\<dir1>\<dir2>

Then I use the commands:

 

private var startupSoundSmiley Frustratedound = new Sound();
startupSound.load(new URLRequest("<dir1>/<dir2>/<file name>.mp3"));
startupSoundChannel = startupSound.play();

 

When I simulate it on my desktop, it's working well.

When I simulate it over the simulator, the sounds aren't working. startupSoundChannel is getting null in return.

Note that I'm using the 0.93 version, if it makes any difference.

 

I'm assuming somehow the files aren't copied to the simulator somehow. This would seem strange, as I'm using a similar way for .png files.

 

What can be the issue?

Is there some other recommended way to use sound files?

Any help is appreciated.


approved apps:
Have a Nice Day!
ABCs
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: how to use sound files

 


shlomiag wrote:

Note that I'm using the 0.93 version, if it makes any difference.


It makes all the difference in the world.  Try searching the board for "0.9.3 sound" (or "audio") and you'll see.  Upgrade to 0.9.4 (best to do both sim and SDK) if you want to test sound.

 


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 386
Registered: ‎12-12-2010
My Device: BB Style
My Carrier: Sprint

Re: how to use sound files

[ Edited ]

And even on 0.9.4 its kind of hit and miss... some times i dont hear any sound and i need to reboot the simulator to hear it. And so far only mp3 works..none of the other media types play..perhaps lack of codecs on the simulator.

 

This was kind of an annoying point for me as i had initially planned to write an FM radio app to play a streaming WMA. but i can't until i get the PB..