I use SimpleAudioEngine::sharedEngine()->playEffect to play some sound when needed, the fps drops under 50 sometimes while playing sound.
But if I turn off the sound, the fps keeps stable at 54fps on my Android device. I wonder if there are any performances issues in SimpleAudioEngine?
I doubt that maybe the other part of my codes effects the fps, so I create a new clean project. every time I touch the screen, I play sound once. The frame rate drops!
I also set -DCOCOS2D_DEBUG=0.
I checked the CocosDenshionTest, it has the same problem on my device.
Have you ever met this problem? Thanks in advance.
In your opinion, The letancy is the reason which makes fps drops down?
Do you have any advices of solving this? I see many games in Android have a good performance with Audio.
In few days i will implement my own OpenSL ES sounds in android. I have only bad performance when i for example collect coins so i really have a lot of sounds. Another problem is your bit rate. If you have all your sounds in MP3 in 320 kbps it is useless you can drop quality and you don’t hear a difference.
Another thing is do you preload your sounds? Remember preloading to much sounds is also bad
For 1 frame in 60 FPS you have 16 ms so when you use Java code you must also add other things i think except letancy
SimpleAudioEngine is a great platform and works very well for many games. If your game is exceeding SimpleAudioEngine on Android, then remember you’re also exceeding the underlying Android OS sound systems like SoundPool and MediaPlayer. If those aren’t enough, you’ve got some work ahead of you, like Dawid says, implement your own OpenSL sounds.
In few days i will implement my own OpenSL ES sounds in android. I have only bad performance when i for example collect coins so i really have a lot of sounds. Another problem is your bit rate. If you have all your sounds in MP3 in 320 kbps it is useless you can drop quality and you don’t hear a difference.
>
Another thing is do you preload your sounds? Remember preloading to much sounds is also bad
>
For 1 frame in 60 FPS you have 16 ms so when you use Java code you must also add other things i think except letancy
Thanks for your reply. I am considering decreasing quality of my sounds to see if it will be OK. otherwise, I have to do it with OpenSL.
SimpleAudioEngine is a great platform and works very well for many games. If your game is exceeding SimpleAudioEngine on Android, then remember you’re also exceeding the underlying Android OS sound systems like SoundPool and MediaPlayer. If those aren’t enough, you’ve got some work ahead of you, like Dawid says, implement your own OpenSL sounds.
THX:)
I know it’s weird. I just play a wav sound in a sample, no extra codes, the fps isn’t stable on my device. I am going to try other devices to see if there are any problems on my own device
Cory Trese wrote:
> SimpleAudioEngine is a great platform and works very well for many games. If your game is exceeding SimpleAudioEngine on Android, then remember you’re also exceeding the underlying Android OS sound systems like SoundPool and MediaPlayer. If those aren’t enough, you’ve got some work ahead of you, like Dawid says, implement your own OpenSL sounds.
>
THX:)
I know it’s weird. I just play a wav sound in a sample, no extra codes, the fps isn’t stable on my device. I am going to try other devices to see if there are any problems on my own device
What device are you using? I’m playing several sounds in my latest game and see no FPS drop.
Also you can try other format like ogg i think for me it works the best but i am not sure i also must make more tests
,sure I’ll try. I deploy my game on Galaxy SII, it performance better.