mackron / miniaudio

Audio playback and capture library written in C, in a single source file.
https://miniaud.io
Other
4.11k stars 364 forks source link

Glitch encountered when using spatialized audio #885

Open foxtacles opened 3 months ago

foxtacles commented 3 months ago

Issue was originally reported in source repository, but adding it here for visibility - also curious if this issue can be reproduced by others.

I've noticed a "crackling" sound artifact in a few cases when spatialization is enabled. Here's a video with the sound artifact:

https://github.com/isledecomp/isle-portable/assets/1135351/4f2ba446-8a41-494e-af7e-52c94b73833f

I've set up a minimally reproducible example app for this issue here:

hospital.zip

It would seem the problem is related to the fact that the "siren" sound is set to have a high volume:

ma_sound_set_volume(&siren, 0.984011f); // must be high

However, the issue is not present when spatialization is disabled.

ethindp commented 3 months ago

I've noticed this too. With a simple sine wave at 200Hz looping from an in-memory stream I notice a slight crackling when the sound loops.