client-sdk-unity icon indicating copy to clipboard operation
client-sdk-unity copied to clipboard

RTC EchoCancellation does not work

Open c4zhutia opened this issue 1 year ago • 10 comments

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.

c4zhutia avatar Oct 19 '24 09:10 c4zhutia

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.

ds199895 avatar Nov 04 '24 16:11 ds199895

Thank you. Did you test the echo on andriod? or IOS? I found the code: image Only on IOS, DefaultMirophoneSampleRate differs from DefaultSampleRate.

c4zhutia avatar Nov 15 '24 10:11 c4zhutia

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

paul-vinogradov avatar Dec 06 '24 11:12 paul-vinogradov

@c4zhutia Did you find the solution? I tried all the above solutions, but the echo cancellation still doesn’t work on my side.

henry-castalk avatar Feb 19 '25 11:02 henry-castalk

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 avatar Mar 01 '25 09:03 davidzhao

@davidzhao Hi. I noticed that this PR has been merged. When will it be applied to the client-sdk-unity SDK?

henry-castalk avatar Mar 11 '25 01:03 henry-castalk

@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 avatar Mar 25 '25 02:03 c4zhutia

@c4zhutia Thanks for your information. I hadn’t thought about this approach! 😁 It could also work on my side.

henry-castalk avatar Mar 25 '25 03:03 henry-castalk

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?

phpmaple avatar Jun 09 '25 06:06 phpmaple

@davidzhao In the new version 1.2.4 this problem still occur on Android devices

CosmopolitiWideverse avatar Jun 18 '25 07:06 CosmopolitiWideverse