Batch Transcription
Source: 09_batch_transcription
Reads a local audio file, uploads it to the OpenAI Whisper API in one shot, and writes the transcript to a text file. Unlike the local speech transcription example, no model needs to be downloaded — the full audio is sent and a single transcript block is received back.
Running
melodium run 09_batch_transcription/Compo.toml \
--input meeting.wav \
--openai_key sk-...[…] info: stt: reading audio file…
[…] info: stt: transcription completeHow it works
The pipeline is linear: read file → transcribe → write.
See in Compositeur StudioBlock/Stream bridging
transcribe returns a Block<string> — a single value emitted once the full transcript is ready. Two downstream operations consume it, requiring two different adapters:
transcribe.transcript --> checkDone.value,check -> logDone.trigger
transcribe.transcript --> sttStream.block,stream -> write.textcheck<string>()discards the string value and emitsBlock<void>, used only to trigger the logstream<string>()converts theBlock<string>into aStream<string>thatwriteTextLocalcan consume
The --> fan-out feeds both branches simultaneously from the single transcript block.
Dependencies
[dependencies]
std = "0.10.1" # core flows, logging, data structures
fs = "0.10.1" # local file I/O
ml = "0.10.1" # LLM, STT, TTS and local model inference