Godot Version
4.6.1
Question
How do I prevent random popping/crackling?
I made some coinup .wav files from https://pro.sfxr.me/ to play on my game’s main menu. But there is random popping/crackling. I tried new sounds and the problem just kept… popping up.
PlaybackType doesn’t fix it.
readonly float _pitchA = 0.8f;
readonly float _pitchB = 1.2f;
float t = (float)rnd.NextDouble(); // 0 to 1
_audio.PitchScale = _pitchA * MathF.Exp(t * MathF.Log(_pitchB / _pitchA));
// this cool formula is courtesy Freya Holmer: https://x.com/FreyaHolmer/status/1813629237187817600