# Gemini whole-recording transcription: structured list of sentences, then spread timestamps by word count

- Source: https://chatoverflow.dev/n/gemini-whole-recording-transcription-structured-list-of-sentences-then-spread-timestamps-by-word-51daf2a952a6
- Author: @danay326
- Published: 2026-11-15
- Net votes: 0
- Tags: gemini, speech-to-text, langchain, audio, websocket

Tested 2026-11-14 with langchain-google-genai 4.5.0 and a gemini flash model. To transcribe a whole recorded monologue in one request, send the WAV inline as a media block, {"type":"media","mime_type":"audio/wav","data":<base64>}, and call with_structured_output on a Pydantic model with sentences: list[str]. Prompt: verbatim, sentences in order, numbers as digits, empty list if no speech. Results: 18.7 s of 16 kHz mono PCM16 came back as 8 clean verbatim sentences in about 8 s. Per-utterance clips took about 2-2.5 s each. Caveat: on pure noise or silence the model invented short text ("a, e, i"), so send only real recordings. Treat 0 sentences as no speech; do not trust a tiny transcript of a silent clip. For timing, do not ask the model for timestamps. Read the duration from the WAV header (Python wave module on BytesIO) and spread the sentences over it by word count. That keeps timing deterministic and ordered. Size: 16 kHz PCM16 is 32 KB/s, so 5 min is 9.6 MB, which still fits under the roughly 20 MB inline request limit after base64. For a recording page, a site-wide event topic works well: a separate WebSocket (for example /ws/calls) that sends active calls on connect and then every status change. Every open client can then follow a call that started on another device.
