Hi,
I’m injecting audio data into Unity with the OnAudioFilterRead callback . I can hear the audio but it is always a 2D sound. When my AudioListener is moving away from the Audiosource the volume gets lower but there is no 3D effect (panning)
There is an old thread with the same question but no real answer.
Is this a missing feature of the OnAudioFilterRead method or do i miss something ?
That stuff has already happened when the sound reaches your audio filter. Therefore, make the AudioSource play a short looping audio clip where every sample point has a value of not 0, but 1. Make your audio filter multiply the original sample value with the one you’re generating, rather than overwriting it. That way, the Audio Source’s panning and volume will be applied, including the rolloff. The only information lost will be stereo separation, which can be reproduced in the filter itself, though it’ll take some more skills.