Using a script with OnAudioFilterRead as an AudioSource

Hallo,
I made a script that loops several small wav files seamlessly using OnAudioFilterRead, it has the clips linked directly in the script. I want to control the output from that script as an AudioSource, so I can change things like Pan, volume, etc. But I can’t get it to work.

I saw a post from Soren saying the following:

So I have my script and an AudioSource with no clip assigned on the same GameObject, then a camera next to it with an AudioListener, but I don’t get any audio, and the VU Meter doesn’t appear on my script.

If I set the AudioListener in the same GameObject as my script, then I do get the audio and VU meter, constantly, but it ignores de AudioSource completely and I have no control to play or stop it.

Is my hierarchy wrong? I’m probably missing something really trivial.

Well, I just restarted Unity and it is working now :expressionless:
Maybe a bug? hard to tell at this point.

Anyway… and that’s the way you use a OnAudioFilterRead script as an AudioSource!

Worked when I clicked “Play on awake” for me :slight_smile: