02-22-2011 08:25 AM
02-22-2011 08:43 AM
Following advices from here, I'm embedding small sound files, for sound effects. It seems quicker to load and start playing.
02-22-2011 08:46 AM
If the sound needs are simple, the Sound class works fine. The Adobe Flex/AIR SDK has good documentation on this as well as there are some threads here about it.
If the sould file is small and you need very quick access to it (e.g. mouse clicks, button presses, etc), then I would embed. If it is a longer sound effect for things like background special sound effects, then I would load dynamically (URLRequest) from app-storage.
Sound does not currently work on the 0.9.3 simulator, but it did in 0.9.2. Works as an AIR application as well.
02-22-2011 08:59 AM
That decision highly depends on what type of app you are building and more importantly, what level of importance the audio plays within your app. Generally the following guidelines apply:
1. Use .mp3 format where possible. For short sounds try diminishing quality as long as possible.
2. Embed background ambient track and loop it thru code:
backgroundLoop.play(0, int.MAX_VALUE); //you can assign a channel too.
3. Short Sound Effects can be loaded dynamically (make sure you reuse them in some way though. Also, note that loading assets dynamically several times is not recommended practice.).
4. Try merging common sound effects in the main background sound asset (if exists). Sometimes, some sound effects are played at regular intervals so merging them is one excellent way to avoid overloading.
These are my general advices on sound. I hope it helps.