No Audio Interruption event

Dear OpenAI community :

I’m facing an issue with OpenAI’s TypeScript Agents SDK, where when a websocket transport layer is configured, the audio_interrupted event never fires when it should.

The issue is as simple as that, however so annoying as well.
Does anyone face this problem too, please? I so, did you manage to fix it?

Hey gregory_buffard,

Yeah, this is expected behavior when using WebSocket transport, and you’re not doing anything wrong.

With the Realtime API, audio interruption works differently on WebSocket vs WebRTC. On WebRTC, the server manages audio playback, so it can automatically detect when playback is interrupted and emit higher-level interruption events. On WebSocket, the client owns audio playback, so the server doesn’t know what audio has actually been heard which means events like audio_interrupted may never fire.

Instead, the docs call out that input_audio_buffer.speech_started is the signal you should rely on when using WebSocket. When you receive that event, you’re expected to:

  • stop playback locally,
  • track how much audio was played,
  • and send conversation.item.truncate with audio_end_ms to truncate the unplayed audio.

If you want interruption to be handled automatically (with server-side truncation and higher-level interruption semantics), you’ll need to use WebRTC transport instead.

Docs that explain this flow: