Audio slow down and crackling.

I’m experiencing issues with audio where it slows down and starts crackling at random times both inside the Editor and the Standalone Player. It happens even if I simply preview the audio file in the Inspector. I tried switching my audio drivers from “NVIDIA High Definition Audio” back to Windows 10 “High Definition Audio Device” but that didn’t seem to make any difference.

Anyone know why this could be happening and how I can fix it?

bump…

bump x2

Anyone have any suggestions regarding this issue?

What does random mean? Does it work normally for 5 minutes and then crackles for 1? Is random but semi regular?

Does changing the latency settings change anything?

Not a clue.

What version of unity?
What platform?
What kinds of audio files are they?
Is the sample rate of unity the same as the sample rate of the audio files?

Create a new project for testing, drag one of the problem audio files into the project and preview it a bunch of times. Is the problem still there?

I’ve been experiencing (what I believe to be) the same problem as OP. For me, it tends to occur after extended usage in Play mode, or extended play of a Standalone build. It’s not super common, but also an unacceptable bug due to how much it distorts the audio. What’s most concerning is that I’ve had Alpha testers report this same problem to me after playing the build on their PC, indicating that it’s not an issue local to my computer. Additionally concerning is that this thread is the only one I’ve seen addressing this issue.

To give more information per another users response:

I’m using version 2019.3.14f1
Platform is PC (Windows is what I use)
Audio files are a mix of .mp3 and .wav. (although, the bug, when it occurs, happens across the board and distorts all the audio in the game (music, sfx, etc.))
Audio file sample rates are set to Preserve Sample Rate (which is the default. I didn’t change any settings for these audio files from the default per compression, load type, quality, etc.)

Did anyone here ever find a solution to the bug or learn anything more about this issue? If this thread is dead I may make a new post regarding this issue, since it seems fairly unaddressed as far as I can tell.

Maybe it’s related. I had a similar issue, but just in the Editor(2019.4) AFAIK. Slow preview w/ crackling. In Project Settings > Audio > DSP Buffer Size. If I have it set to Best Latency then I get the issue. Any other setting doesn’t cause the issue.

17 Likes

I’m getting this on a standalone (release) build from Unity 2020.3.15f1 on Windows 10. The game will run perfectly normal and then after about 5-10 minutes of play, all game audio will start to “crawl” at about 1/2 to 3/4 speed with lots of popping and crackling. This will continue for a few minutes and then clear up. Anyone else have the same issue or a solution?

2 Likes

Seeing this in the Editor a LOT. Using 2020.3.21f

Thank you!! I solved it this way.

1 Like

This also solved it for me (Unity 2021.3.0f1) by just changing from “Best Performance” to Default and back to “Best Performance” again…I’m concerned though, that the issue could come back at any time on a build >:0

If there is speed or crackling noise issues, its usually a sample rate mismatch. Might have to re-render the audio at the project’s bitrate

Thanks for the replies, I will look into these options

Experienced this same behavior using version 2021.3.8. Choppy rendering and audio crackling, not in the editor, but only in the build output. I tried a number of things described on this thread (and beyond), but what I found to fix the issue was changing the OS native resolution from 3840x2160 to 1920x1080 (Windows). Also, the machine I was testing on was a laptop, so the power was less than my usual desktop development machine.

Now the new problem, for me, is how to detect high (or scaled up) resolutions and provide the customer some choices when running the game. Thanks everyone for sharing your experience with this issue.

A bad configuration of your sound card, that includes equalisation, audio quality (24, bits, 16 bits, etc…) and sampling resolution.

I could be caused by dirty speakers too, so cleaning with compressed air could be the solution.

Finally a bad mounted speaker could be the reason, as they vibrate, they will slowly unacrew, even if they are pasted with some kind of adhesive they will loosen with the years and years of deadmou5e, so open your pc and rescrew them if you know ehat you’re doing, other wise, hand your computer to a teky pearson.

I know this is a late response, but I hope it is helpful for new people coming here for solutions.

For Unity 2021.3.10f1, I can confirm the same behavior in Windows Editor. On Audio - DSP Buffer Size “Best Latency”, this happens. Changing it to “Good Latency” it seems not to happen anymore. Sound device is onboard Realtek Audio (showing as Dell/AMD F17/19 (Ryzen2/3, TR/2) HD Audio Controller in SiSoft Sandra) on AlienWare mainboard (model: 0TYR0X) from 2021. My desktop and game frame rate runs at 144 Hz.

The audio file used is an mp3 file, which as audio clip I tried both “Decompress on Load” with preload and streaming. Compression format is set to Vorbis, Quality 100, Preserve Sample Rate which is 44100 Hz, Stereo.

Experienced this in 2019.4.36f1 in Windows 10 Editor. Happens with the “Best latency” setting as well. Changing it to “Best Performance” also resolved this for us. I am running a Legion Y740-17IRHg using Realtek Audio on 64 bit Windows 22H2 19045.2486.

This same issue happens on 2021.3.27f1 and 2022.3.4f1. Changing to “Default” from “Best latency” fixes the bug right away!

2 Likes

Edit: On further exploration, audio playback via Best Latency seems to be broken for PC builds. Audio will crackle in a build and Audio clip playback will be messed up in Editor. Default (1024 bitrate) works fine.

Same here. For anyone who wants “Best Latency” while avoiding this issue in Editor, you can adjust audio settings at runtime, such as:

AudioConfiguration audioConfig = AudioSettings.GetConfiguration(); //Thanks kodra_dev for pointing this out
audioConfig.dspBufferSize = 256; //  This is the buffer size for "Best Latency"
AudioSettings.Reset(audioConfig);
2 Likes