adrenak / univoice

Voice chat/VoIP solution for unity.
http://www.vatsalambastha.com/univoice
MIT License
363 stars 36 forks source link

Support AudioMixer or AudioFilter #24

Closed zeroone-ved closed 9 months ago

zeroone-ved commented 1 year ago

Sometimes we need to apply additional effects to audio sources, such as using bandpass filtering to filter out vocals and remove ambient noise. Can we support custom extensions for sound effects at the interface level?

adrenak commented 1 year ago

Hi @zeroone-ved there's no API for this yet, but you can change the outgoing audio before IAudioOutput.OnSegmentReady event is invoked. For example, have a look at this file in the univoice-unimic-input repo

The Mic_OnSampleReady method is where the samples from mic come in. You can make modifications to audio samples here.

zeroone-ved commented 1 year ago

Thx for sharing this method, it would be helpful to do some post effects. But I just get the AudioSource component, and bind one AudioMixer after method AddPeer finished. This saved me much time, so that I don't need to write codes for audio signal processing.

adrenak commented 10 months ago

Hi @zeroone-ved

Did you work on this further? I could catch from your previous comment.

The UniVoiceAudioSourceOutput class exposes its AudioSource instance via a public property

You can access its gameobject from which a peers sound is emitted. With this gameobject you can do a lot of things: