openai/openai-realtime-api-beta

Interruption of assistant in VAD mode not working

Opened this issue · 4 comments

In VAD mode it seems you cannot interrupt the assistant. It makes a short break, but then keeps on going.

I agree, this seems to be a common issue. It also seems to interrupt itself a lot.

Thanks for the confirmation.

I was able to get it working pretty well. Heres how

  1. System constantly processes microphone input at regular intervals (every 0.1 seconds)
  2. Input is converted to PCM16 format and sent to OpenAI's server
  3. Server performs Voice Activity Detection (VAD)

User speaks during AI audio →
→ Server detects speech ("input_audio_buffer.speech_started" event) →
→ AudioManager stops current audio playback
→ System cancels active response
→ All states reset (isResponseActive, activeResponseId, etc.)
→ System ready for new interaction

are you hosting the client on an external server? Or are you implementing it client side?