- Home /
Echo/Feedback loop in VoiceChat over phone/speaker.
We've implemented VoiceChat ( https://github.com/fholm/unityassets/tree/master/VoiceChat ) to use it in an Android game.
The problem is, when two people are talking, since the voice is coming from the phone's speaker instead of headphones, there'll be a feedback loop of the voice with echo. Why is this happening when it doesn't happen in normal phone calls with speakers? And is there any way to prevent it in Unity?
Answer by Bunny83 · Aug 23, 2016 at 01:54 PM
The feedback does always happen. So the question should be: Why do you not hear such loopbacks in other pieces of software. The reason is that advanced voice chat software (like skype / teamspeak) have implemented a quite complicated audio analysis of the microphone and with respect to some delay they try to subtract the speaker signal from the microphone input.
This is by far more complicated than it sounds ^^. The phase of the two audio signals have to perfectly match. So the data that goes out the speaker will arrive a tiny bit later at the mic. So depending on the room properties in respect to size and echo that time will vary. Also you can have multiple reflections off walls which makes it even more complicated.
See this post. Also have a look at this post, it's not directly related but shows some of the problems you have to tackle.
I was scared that was going to be the answer... :(
Are there any Unity libraries/assets that already handle this? Seeing as how, as you mention, it's quite the endeavor to do this from scratch.
Your answer
Follow this Question
Related Questions
Teamspeak SDK, Client fails to open devices 0 Answers
Teamspeak SDK, EntryPointNotFoundException 1 Answer
Voice chat in browser based unity projects 3 Answers
Speech recognition on Android with Unity 3D 0 Answers
Recording cannot proper play in unity? 0 Answers