RTC EchoCancellation does not work
Hello,
I have an agent and a participant in the room, and the participant can talk to the agent and the agent will talk back to the participant. However, if a participant is using speaker inside of earphone, the voice of agent will be recorded by microphone and send the voice to agent back. Once the agent hear the voice, it will stop current conversation and instantly talk back to the participant. This kind of ping-pong situation makes my app totally unusable.
I have checked that the newAudioSource.Options.EchoCancellation is set to true. It seems like it does not work.
For me i comment these code
and in the livekitSample class i add the type of microphone when create rtcSource in the pulishMicrophone function
and then it works well and no echoes.
Maybe it is the problem of sampleRate, but I am not very familiar with audio.
I'm glad to discuss any further.
Thank you. Did you test the echo on andriod? or IOS? I found the code:
Only on IOS, DefaultMirophoneSampleRate differs from DefaultSampleRate.
did this actually work for you? Commenting that out doesn't change the sample rate, it's set to the default in declaration on non-ios platforms
@c4zhutia Did you find the solution? I tried all the above solutions, but the echo cancellation still doesn’t work on my side.
we are working on adding echo cancellation to this. It'll be added to the Rust SDK via this PR, and the options will be enabled thereafter.
@davidzhao Hi. I noticed that this PR has been merged. When will it be applied to the client-sdk-unity SDK?
@c4zhutia Did you find the solution? I tried all the above solutions, but the echo cancellation still doesn’t work on my side.
We build a Flutter APP as a shell to wrap Unity. The echo cancellation works well at app side. Now the room contains 3 people, agent, user from app, user from Unity. The user from app only records sound. The user from Unity only play sound.
@c4zhutia Thanks for your information. I hadn’t thought about this approach! 😁 It could also work on my side.
we are working on adding echo cancellation to this. It'll be added to the Rust SDK via this PR, and the options will be enabled thereafter.
Is this resolved?
@davidzhao In the new version 1.2.4 this problem still occur on Android devices