Interrupt realtime audio with text message - WebRTC

Hi everyone,

I’ve been working with the WebRTC template.

When I interrupt the model using my voice, the audio output from the server stops immediately and restarts once I’ve finished speaking. (as expected)

I want to replicate this behavior for text input: when sending a text message, I’d like the audio to stop immediately and then restart to respond to the text.

I’ve tried using response.cancel, conversation.item.truncate then conversation.item.create with input_text and response.create but the audio continues playing until the end of the transcript.

Has anyone successfully implemented this functionality?

Thanks!

2 Likes

I’m trying the same thing. I have not found a solution so far. I guess the problem is that the audio has already been received when you cancel the response and therefore it is still played from the audio output buffer.

1 Like

You could try converting the text to speech with a TTS engine and then sending that file as audio…

1 Like

Hi OpenAI, this is a serious issue, it worked fine , it worked on the WebSocket issue correctly, please help