Client-VAD speech segments

PreviousNext

When and how to use synchronous segment transcription.

Use Segment Transcription when your application already knows where speech starts and ends.

When to use Segment

Use SegmentUse something else
You run VAD locally and upload one clip per utteranceContinuous mic stream → Realtime WS
You need a synchronous transcript in ~2.4sLong file at a URL → Batch jobs
OpenAI Whisper file upload patternServer should detect silence → Realtime WS

Contract

  1. You segment — only POST clips that contain speech you want transcribed.
  2. We do not filter — silence, near-empty WAVs, and noise are transcribed as-is.
  3. You pay for what you send — wasting quota on silence is the caller's responsibility.
  4. No server HTTP retry — up to 3 worker attempts (800ms each) per request; on 502 the client may resend the same clip.

Typical flow

  1. Local VAD: Client-side VAD detects end of speech utterance.
  2. Audio Encoding: Encode audio segment into WAV/PCM buffer.
  3. HTTP Request: POST /v1/audio/transcriptions (multipart form data).
  4. Response: Receive 200 OK with transcription JSON (or 502 to trigger client-side retry).

Integrators like Flow follow this pattern: WebSocket voice session → local VAD → HTTP segment per utterance.

Example

curl -X POST https://audio.lansonai.com/v1/audio/transcriptions \
  -H "Authorization: Bearer sk-..." \
  -F "file=@utterance.wav" \
  -F "language=zh"

Anti-patterns

  • Uploading a full meeting recording to Segment — use batch audio_url instead.
  • Streaming continuous PCM to Segment — use Realtime WS.
  • Expecting the API to skip silence — it will not.