Sound pitch not working correctly on Windows - solution

I’ve noticed, that sound pitch on Windows is ignored sometimes.
After some testing, I’ve found out that after invoking Apply3D, the pitch is reset.
This fix works for me:

float pitch = instance.Pitch;
instance.Apply3D(audioListener, audioEmitter);
instance.Pitch = pitch;

I’m using MonoGame 3.8.0.
This fix is not needed on other platforms (Android, DesktopGL).

1 Like