Skip to main content
Participant
March 8, 2012
Question

bad performance when playing sounds on ios

  • March 8, 2012
  • 3 replies
  • 1876 views

Does anyone knows the best way and audio format to use for playing sounds for ios with AIR.

I use the basic method sound.play() but performances during my game are horrible. Playing on sound when my character jumps affects the fps badly.

I use nape physics and Starling, my game is running at 60 fps on iphone 3gs, but it is barely unplayable with just on sound.

Thanks

This topic has been closed for replies.

3 replies

Known Participant
March 25, 2012

I've also been dealing with this issue. I had to drop the number of sound effects by a heafty amount to deal with. Lowering the bitrate of the sound effects will also help.

Inspiring
March 24, 2012

Hey Tom,

I have the same problem for a very long time and still didn't manage to solve it, any luck on your side?

Thanks!

March 8, 2012

Try using the sound channel class, I've seen great results with it on iOS and android, no sound lag after initial load.

http://www.republicofcode.com/tutorials/flash/as3sound/

Participant
March 8, 2012

Ok thanks, I tried it, but it does'nt changed anything. Actually my problem is not sound lag but fps loss when playing a sound (the sound if perfectly played but my animations are not). I did'nt think playing one sound would use so much ressources. I 'm going to reduce my animations and clean my code.

Do you use mp3's or wav's. Do you think the format is important, maybe the Iphone work better with one format or one specific compression.

Thanks again.

March 8, 2012

I tend to use MP3s. Check out my app called Alpha-Zet available on all android and ios devices it uses animations and sounds when the animation is tapped, I don't notice any animation slow down on all the devices I've tested it on, there is some delay on the kindle fire but that's a known issue.

Perhaps your sounds are too high quality or the animation is using all the resources and the sound just puts it over the edge. Have you tested CPU vs GPU on export? Try setting your stage quality to LOW.