#OnAudioFilterRead Inconsistent Sample Rate

1 messages · Page 1 of 1 (latest)

dreamy coral
#

I'm using Unity's built-in OnAudioFilterRead function to do a denoising effect.

However, the denoising algorithm expects a 48kHz input, while the sample rate of the OnAudioFilterRead (calculated by buffer size / delta time between each call) fluctuates all over the place. As a result, the generated output sounds distorted.

Does anyone have any idea how to solve this?

(The sample rate I calculate might be wrong too. IDK)

dreamy coral
#

Went to Project Settings and change the output sample rate to 16000 instead.
Now the audio sounds significantly better, but still a bit of distortion left.
Perhaps my office PC is too slow to handle it.