How do I add audio filter in VIOP component and configure the Audio Quality?

How to modify audio using voice filters such as pitch delay and distortion?

e.g.: users can change their voice to anime Girl, Robotic, Metallic and others.

or please share some sample code or to access audio stream where we can add our filters. and change quality like mono, stereo bitrate, etc

Original Post on Discord

by user 406778568597831690

Hey :wave: Maybe someone from Needle will answer with some alternative solution.

The Voip doesn’t seem to be ready for effects like that out of the box…

But if you open up the Voip.ts, you’ll find that the AudioConnection has a currentAudio which is type of THREE.Audio. That takes us to Three.js docs https://threejs.org/docs/#api/en/audio/Audio.filters, where there is a filter property controlled by setFitler / getFilter.

I wasn’t exactly able to find any example code on possible filters, but i think it is definitly doable, since now you are in the realm of pure Web dev / three.js specific implem of it.

So one variant would be to add filters to the AudioSources that are being played. Effect would be applied while “Playing the sound” of the remote user on your local device.

You could also edit the microphone stream.

This seems to be the implementation how to get a microphone stream that is used.

So you would have to essentially copy the whole Voip script and maintain your own, so you can insert the filters there.

Maybe similar to this:
https://stackoverflow.com/questions/53104099/apply-effect-on-microphone