Closed robcontreras closed 3 days ago
I spent a bit of time looking at this and got interruption working quite well on my branch. Here are a few things:
input_audio_buffer.speech_started
eventresponse.audio.delta
eventHope that helps!
Just want to chime in that we're looking at interruptions/preemption on the node version at the moment: https://github.com/twilio-samples/speech-assistant-openai-realtime-api-node/issues/9 .
@jhmaddox you're using a queue and Mark message to determine when to send the next response.audio.delta
to Twilio?
@robcontreras
I had success with doing this:
if response['type'] == 'input_audio_buffer.speech_started':
await websocket.send_json({ "event": "clear",
"streamSid": stream_sid })
It flushes the twilio audi stream. Basically clears whatever you sent already.
https://github.com/twilio-samples/speech-assistant-openai-realtime-api-python/pull/13 I have a PR here if anyone would like to test. It should work within a reasonable error around your interruption. We're looking internally as well.
https://github.com/twilio-samples/speech-assistant-openai-realtime-api-python/pull/13 closing with this merged
I can successfully connect and and event is received when I start speaking, but it gets hanged here, it never detects when I stopped and it just stays there until the timeout is reached, am I missing something?