- Home /
Audio Crackling in Unity 4 - Possibly related to adjusting volume at run-time
I'm trying to figure out why I'm getting so much audio crackling in Unity 4.
Our project is working on a PC/Mac/Linux Build with a decent 60+ framerate but all sounds (mostly SFX) have a heavy amount of crackling to them. Since FMOD was used after unity 2.5 (something like that) I haven't seen other complaints.
So I believe the issue is related to adjusting the volume of sound sources directly in the game at run-time (Is this bad practice?), disabling these features seemed to help a bit, but there is still noticeable cracking.
Any ideas why this is happening?
This is gonna sound silly, but have you played the sounds in another player, like VLC or W$$anonymous$$P, to make sure they're not actually just krackly naturally?
I personally haven't encountered crackly sounds, and I have adjustable sound volume in a current project. What method are you using to adjust the volume? Perhaps there's something in that which is introducing noise.
Yep, those are all fine, even when played through the editor.
Swapped out other SFX to ensure it's not a corrupted asset, same result.
I'm adjusting the volume via a C# script by storing a reference to the AudioSource component playing the source and adjusting it's volume property every frame. The idea is to make the volume of the source correlate with the amount of a certain resource (in this case, air in their oxygen tank. $$anonymous$$ore air = louder volume)
Also, I've tried changing the priorities of certain sounds to 0 to see if low channels are the issue, but no, still crackling even on a single sound with priority 0.
The only other thing I know of is to change the bitrate in the audio file's import settings in Unity itself. You could probably use some information panel in Audacity to deter$$anonymous$$e the file's bitrate and then set that in Unity.
Are you telling the sources to change position to try and loop them, or looping sounds?
Did you also check the compression quality?
I do fadein/fadeouts in my game in the same way and have experienced no problems so far.
Your answer
Follow this Question
Related Questions
Audio controls disabled??! 0 Answers
Audio not coming out of speakers 1 Answer
How do I play a sound when pressing the W key, and when I stop pressing the W key, the sound stops? 2 Answers
Why does sound on Android play at double speed and crackle? 3 Answers
Calculating rhythm of any music? 3 Answers