Treatment transcribeContinuous
ml/remote/stt::transcribeContinuous
Configuration
⬡ stt: ml/remote/stt::RemoteStt
Inputs
⇥ segments: Stream<Vec<byte>>
Outputs
↦ error: Stream<string>
↦ failed: Stream<void>
↦ transcript: Stream<string>
Continuously transcribe a stream of audio segments to text.
For each Vec<byte> received on segments, submits it as a complete, independently
decodable audio clip to the configured provider and emits the resulting text on
transcript. The treatment runs until segments is closed.
Each item on segments must be a self-contained audio blob — the caller is
responsible for producing meaningful segment boundaries (e.g. one WAV blob per
utterance from a voice-activity detector, one chunk per WebSocket message from a
streaming API, etc.). Splitting at the raw byte level within an encoded format
would corrupt frames and produce garbage transcripts.
If a single segment fails, failed and error are emitted for that segment and
processing continues with the next one.
graph LR
T("transcribeContinuous()")
S["🟩 🟩 🟩 …"] -->|segments| T
T -->|transcript| R["🟩 🟩 🟩 …"]
T -->|failed| F["🟩 🟩 🟩 …"]
T -->|error| E["🟩 🟩 🟩 …"]
style S fill:#ffff,stroke:#ffff
style R fill:#ffff,stroke:#ffff
style F fill:#ffff,stroke:#ffff
style E fill:#ffff,stroke:#ffff
use ml/remote/stt::RemoteStt
use ml/remote/stt::transcribeContinuous
treatment example()
model stt: RemoteStt(backend = "openai", api_key = "sk-...", model = "whisper-1")
input segments: Stream<Vec<byte>>
output transcript: Stream<string>
{
transcribeContinuous[stt=stt]()
Self.segments -> transcribeContinuous.segments,transcript -> Self.transcript
}