Sound Causing Jumpy Rendering

Monkey Targets Forums/Android/Sound Causing Jumpy Rendering

evolving_developer(Posted 2017) [#1]
I am making my first game with sound and focusing on the mobile experience. Currently I have only 2 sound effects, shooting and destroying an enemy, as well as background music.

The game has controls for turning the sound on and off, and separate controls for turning the music on and off. I've noticed that when the sound effects are on, the firing sound effect can cause some render lag and makes the game look jumpy.

Any ideas what might be causing it?

Additional details:
Sound files are .wav
I have tried using a range of channels since a new "bullet" can be fired before the sound from the previous one is finished.


Gerry Quinn(Posted 2017) [#2]
You're not loading the sounds each time you play them, by any chance? (Just guessing, not based on experience)


evolving_developer(Posted 2017) [#3]
Only load the sounds once, in OnCreate. Good question though Gerry Quinn


Xaron(Posted 2017) [#4]
Well I once had it with graphics which were dropped out of memory again when needed and had to be reloaded in case of low end devices. Maybe that's something that happens here. Kind of swapping.


evolving_developer(Posted 2017) [#5]
The problem is it happens on all the devices I have tried it on. High end and low end. The game is not that big either.
This morning I tried using .ogg files instead of .wav and it did not change anything.


Jesse(Posted 2017) [#6]
it should only happen the first time you use them. Try playing the sounds with 0 volume on the OnLoad method. it should eliminate the problem. I think.