Copy link to clipboard
Copied
I'm currently doing some game development, targeting iOS and Android devices using Flash Pro and AS3. I'm doing my best to keep the code highly optomized and doing as much object pooling as possible. So far, I'm very pleased with how smooth everything is running on the devices.
I have noticed that when the actual 'game play' starts up, there is often a short hitch the when any particular sound effect is called up for the first time. After the first time its seems fine.
I can only assume that the hitch in game play is Air loading up the soud file into memory (which is why it's hitching only on the first call).
I'm a bit of a novice when it comes to audio, but I'm wondering if there is a best practices when it comes to managing the various sound fx and sound tracks so everything plays smoothly 'without a hitch'. har har. Currently the sounds reside in my Library as exentions of the Sound class, and i just crate an instance of those classes at run time and .play() when i want to call them.
Thanks ahead of time,
-dis
Copy link to clipboard
Copied
I have noticed that the first play of a sound in iOS can be delayed, but subsequent plays are ok. So, just play the sound ahead of time, at zero volume. Then it'll be ready for when it's really needed.
Copy link to clipboard
Copied
Yeah, I have thought about that, it just seemed like an awfully sloppy solution. I was kinda hoping for a non 'hack' method to get them properly loaded into memory- but if thats they only current way- then thats the only currenty way.
-dis
Copy link to clipboard
Copied
Else start your mp3 with some interval.