> ## Documentation Index
> Fetch the complete documentation index at: https://docs.navtalk.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# realtime.input_audio_buffer.speech_started

> User started speaking event

Triggered when the server detects that the user has started speaking via server-side voice activity detection (VAD). Handle this event to stop any current AI response playback when the user interrupts the AI's response.

## Event Properties

<ResponseField name="type" type="string">
  Event type. Always `"realtime.input_audio_buffer.speech_started"` for this event.
</ResponseField>

<ResponseField name="data" type="object">
  Event data object. May be empty or contain additional metadata.
</ResponseField>

<ResponseExample>
  ```json Example theme={null}
  {
    "type": "realtime.input_audio_buffer.speech_started",
    "data": {}
  }
  ```
</ResponseExample>

## Usage Example

```javascript theme={null}
const NavTalkMessageType = Object.freeze({
    REALTIME_SPEECH_STARTED: "realtime.input_audio_buffer.speech_started",
    // ... other event types
});

async function handleReceivedMessage(data) {
    switch (data.type) {
        case NavTalkMessageType.REALTIME_SPEECH_STARTED:
            console.log("Speech started detected by server.");
            stopCurrentAudioPlayback();
            audioQueue = [];
            isPlaying = false;
            playVideo = false;
            break;
    }
}
```

<Note>
  When the user starts speaking while the AI is responding, this event will interrupt the AI response naturally. You should stop audio playback and clear the audio queue to ensure a smooth user experience.
</Note>
