Interrupted by itself when speaker on using websockets in Twilio.
pipecat version
0.0.65
Python version
3.10
Operating System
Ubuntu 22.02
Issue description
When the user calls the bot on speakerphone, the bot's voice may sometimes be taken as input, interrupting the pipeline.
Reproduction steps
N/A
Expected behavior
Bot should ignore its own voice.
Actual behavior
Bot takes the audio as an input and respond accordingly.
Logs
I don't see this issue in my testing using Twilio + FastAPIWebsocketTransport. This sounds like it may be a handset specific problem. What type of phone are you using?
@markbackman , Iphone 16 pro.
Strange. I don't see this. You can try for yourself. Here's a Twilio + websockets bot that's hosted on Pipecat Cloud:
- Call +1-929-556-4263
- It's this demo: https://github.com/pipecat-ai/pipecat/blob/main/examples/word-wrangler-gemini-live/server/bot_phone_twilio.py
@markbackman I've encountered this issue as well. It happens occasionally. I have a voice bot application in production, and for some users, the bot malfunctions.
@markbackman I have been facing a similar issue. It happens randomly. I am using gemini live api with daily transporter
Echo cancellation is available by default when connecting via:
- WebRTC on Chrome/Chromium browsers, and Safari. Firefox does not have echo cancellation built in (which is... suboptimal)
- Phones, which have built-in echo cancellation. Specifically, this works when connecting via speakerphone to prevent the remote party from hearing themself while you speak on speakerphone.
One possible issue is that background sound or ambient noise is causing the bot to be interrupted—not echo from the bot. You can defend against this using noise and background voice cancellation using something like Krisp.
I'm inclined to close this issue unless someone can surface a repro case that points to a Pipecat issue. I'll leave it open for a little longer to allow time to submit a repro case.
I'm having the same issue with IPhone 16 pro max, the own bot is self interrupting