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)