- Home /
Audio popping on pause and volume change
Hello,
My problem is the following: I created a simple audio file and exported it in wav, 44100 Hz, 16 bit quality. I played it on my phone (android) with a music player, it sounds fine. I added it to my game and the speakers pop every time I change the volume or switch to another app and back to the game. In Unity I tried several settings for the audio file: every load type and compression format, even set the DSP buffer size in Project settings to "Best performance". Nothing helped.
What should I do to get rid of the popping sounds?
Thanks in advance.
I think I'd need to know how you are changing the volume to be of any help. I'm assu$$anonymous$$g it's fine during play mode in the editor? Have you tried on more than one device?
Yes, it's fine in the editor. By changing the volume I meant my test device's volume. I tried on multiple devices, the error occurs on all of them.
Do you have only one audio listener? Are you just triggering an Audio Source Component to play on Awake? Is any script involved and have you tried other audio files?
Answer by Honorsoft · Jan 11, 2018 at 05:41 AM
I'm not sure, but I figured I could mention similar issues I noticed with some Android tablets (more often in newer tablet models). It could be a tablet-hardware related issue, and if the way Unity plays sounds is causing popping on some tablets, then no matter what type of sound you play, it will still happen. For me, with my own tablets, I have an RCA tablet with great audio (the tablet is now considered obsolete), and I have a brand new ACER tablet that has 'audio popping' issues when running the same apps and sounds the RCA has no audio problems with. The problems seem to occur when audio is being buffered/loaded into memory, and also when playing short sounds in quick succession, just like when the volume up/down keys are pressed. When I adjust the volume on the ACER tablet (and it makes a sound whenever a volume key is pressed) I get audio popping. A long time ago, I had audio popping issues when programming in C++ on a Legacy system, and I found that the issue was the audio was being played twice (or attempting to play twice), it was a buffering problem with the PC's audio hardware. Issues like that can cause popping, and occasionally extra loud volume on sounds (because the 2 same sounds are played together it is 2x as loud). It sounds like it might even just be that there is a 'power surge' in the audio hardware on the device when the tablet switches to an app (like Unity) who is still playing audio before the tablet is ready to process it (because the tablet is still in the process of switching to it). One problem I've seen lately with newer (usually cheaper) tablets is that they are designed to work on a lower power requirement to extend battery life, but that also means that they are not as capable of supplying power or switching focus to the different hardware in the device (it can cause audio popping, buffering problems, etc). I don't know if anything I said will help, but hopefully it can help you track down the problem. Try compiling and testing on multiple devices if you can to see if it is a specific mobile hardware issue. When you said "the speakers pop every time I change the volume or switch to another app and back to the game" I am having the same problems but only with a certain tablet.
Thanks for the detailed reply. Unfortunately the problem occurred on multiple devices. $$anonymous$$y "solution" was finding some sound files that have no popping issues. I don't know what's different about them, but for now, it's enough for me, that some sounds work. I'll just use the working ones. When I'll have time I'll look into the topic a little more.