amazon-nova-samples icon indicating copy to clipboard operation
amazon-nova-samples copied to clipboard

(S2S sample-codes/console-python) Audio loopback - assistant talking to itself

Open athewsey opened this issue 10 months ago • 1 comments

So I managed to get speech-to-speech/sample-codes/console-python/nova_sonic_tool_use.py up and running, but the assistant's responses seem to get picked up and fed back in as user utterances - as shown by the dialog below (in which I really only said "hi what date is it today"):

User: hi what date is it today
Assistant: Hey there! Today is April eight, two thousand and twenty-five.
Assistant:  It's Tuesday, and the time here is eight thirty-six in the evening, Pacific Standard Time.
User: hey there today is april eight
Assistant: Yep, you got it! Today is indeed April eight. How's your day going so far?
User: yep you got it
Assistant: I'm glad I could help! If you ever need to check the date again, just let me know.
User: i'm glad i could help

The issue is resolved by using headphones, but kind of surprising this feedback occurs because I don't think there's anything particularly non-standard about my audio setup? Just using an (M2 Pro Sonoma 15.3) Macbook Pro with the built-in mic & speakers.

athewsey avatar Apr 09 '25 03:04 athewsey

Yup same with me. I tried and it works fine for few lines of conversation. Then starts talking to itself without any input. And I am in a very silent zone, with no one else around

Ashishkamble004 avatar Apr 09 '25 06:04 Ashishkamble004

Does it happen when you try nova_sonic_simple.py? I wonder if it has to do with the barge in / interruption feature.

tpaulshippy avatar Apr 16 '25 23:04 tpaulshippy

nova_sonic_simple.py starts talking to itself as well, the first couple of turns seems to work fine.

rpgeddam avatar Apr 22 '25 04:04 rpgeddam

this is a known limitation of current pyaudio implementation which doesn't handle echo cancellation.

prettyprettyprettygood avatar Apr 24 '25 17:04 prettyprettyprettygood