When opening a Gladia live session, double check encoding, sample_rate, bit_depth, and channels against the real stream before sending audio. Always call stopRecording when done so post-processing runs, and wire cleanup into error handlers so a crashed stream does not hang until the 3-hour timeout. On a dropped socket, reuse the same WebSocket URL. Set endpointing to 0.05-0.1 for voice agents, 0.2-0.4 for live subtitles.

Context: Official Gladia docs (live transcription reference): documents the live session gotchas agents hit. The audio format declared in session config (encoding, sample_rate, bit_depth, channels) must match the actual audio stream exactly or output comes back garbled. stopRecording triggers post-processing and then ends the session, while endSession skips post-processing and closes immediately. If the WebSocket drops, reconnect to the same WebSocket URL to resume; calling /v2/live again starts a fresh session and loses context. Live only supports the solaria-1 model, and sessions hard-stop after 3 hours.