Skip to main content
Inspiring
October 25, 2011
Question

sound & fps drop-down

  • October 25, 2011
  • 2 replies
  • 2458 views

Hi,

I'm currently working on an iOS game using Flash pro cs5.5 and Air 3 sdk.

My game runs smoothly with 60fps using GPU rendering mode. That is till I start adding background music and sound effects.

Loading the sounds works well but once I start to play the sound files (mp3 files) the frame rate drops 5-10 fps. I have 2 layers of background sound and some sound effects and for each I'm using a different sound channel. with each mp3 file I'm starting to play the frame rate keeps dropping.

I'm using 128kbps mp3 files. I tried using even lower bit rate files and it didn't make a difference.  beside the background music file that is 4mb all the rest are very small in size. I tried both loading the sound using external mp3 files and import the files into the library.

Is playing sounds on iOS using Air a known issue or maybe there's a work around using another file format?

I guess it might be an issue with the fact I'm using GPU rendering and the sound files need to use the CPU, but I'm not sure.

Any help would be appreciated,

Thanks!

Oz

This topic has been closed for replies.

2 replies

Inspiring
October 26, 2011

have you tried deploying your app to your ios device from Flash Pro with the "Deployment -  Apple App Store" type?

Inspiring
October 26, 2011

Hi Saariko,

Yes I did, I'm aware that the test and debug publishing run slower. It dies work a bit better but I'm still receiving the fps drop when playing my sound files.

I red a little bit about AAC format and that it should be better because of file size and quality, but I tried it and not just it doesn't make much of a difference in file sizes when the mp3's are already small, it doesn't change the frame rate drop I'm getting.

I'm sure people already built games and apps that play sounds simultaniuslly. Maybe I'm reaching the limit of the performance I can get but still, playing 1 mp3 in the background makes the fps drop from 60fps to 50-55 fps?

Thanks

Colin Holgate
Inspiring
October 26, 2011

If you think of Flash's history, it used to default to 12 fps, and with the very latest version running on the fastest desktop machine it still defaults to 24. Some people doing high end TV animation dare to go to 30 fps or even 60 fields, but those are often rendered a frame at a time. You're trying to do twice that on a mobile device, in real time.

For a comparison, almost all cartoon work you've ever seen is at 12 fps, and all feature films are 24 fps. Even IMAX is 24 fps. NTSC TV and some console games may seem to give 60 updates a second, but those are half frames, so there are only 30 frames worth each second.

So, overall I think you shouldn't be ashamed of 50 fps.

Inspiring
October 25, 2011

I forgot to mention, the frame rate drop occurs as long as the sound file is playing. It's not just a small lag once the sound starts to play.