Skip to main content
Problem: You copied an ambient streaming client and the Dictation stream never finishes. Solution: On /ws/transcribe, send { "type": "AUDIO", "audioData": "<base64 pcm>" } chunks, then { "type": "EVENT", "event": "AUDIO_END" }. Wait for inbound transcript.transcript === "EOF", close the socket, then call End Dictation session. Do not send ambient RU9G.
This cookbook assumes you already have your Partner ID, authentication tokens, and an active Dictation transcription_session_id.

Common mistakes

  • Send { "type": "AUDIO", "data": "RU9G" } on Dictation. That marker is ambient-only.
  • Close the socket or call REST end before you receive inbound EOF.
  • Open /ws/transcribe again before the session returns to READY or IDLE.

Other cookbooks

AmbientAPI

Authenticate Browser WebSocket Handshake

Auth Dictation WebSocket with protocols.

5 min
DictationSDK

Write Dictation Text to an EHR Field

Write Dictation text with onSubmit.

5 min
Last modified on July 23, 2026