RASTTOptions controls language, timestamps, diarization, and decoding behavior. It is a generated
protobuf message: start from .defaults() and assign the fields you need.
Defaults
.defaults() sets three fields; everything else stays at the proto zero value.
All fields
There is no
enableVAD field on RASTTOptions. Voice activity detection is a separate component;
see VAD.
Language
language is the RASTTLanguage enum, not a string. Cases: .unspecified, .auto, .en, .es,
.fr, .de, .zh, .ja, .ko, .it, .pt, .ar, .ru, .hi.
Two helpers bridge to BCP-47 text:
Auto-detection
Pin a language
Word timestamps
Word-level timing drives subtitles, karaoke, and word highlighting. Times are in milliseconds.RAWordTimestamp
Subtitle grouping
Diarization
Attribute each segment to a speaker. The labels land inoutput.speakerIds and on each
RAWordTimestamp.
Sample rate
Whisper models expect 16 kHz mono. SetsampleRate when the source differs.
Transcription metadata
RATranscriptionMetadata reports what ran and how long it took.
Alternative transcriptions
SetmaxAlternatives to receive competing hypotheses in output.alternatives, each an
RATranscriptionAlternative with text, confidence, and words.
Complete example
transcribe()
Basic transcription
Streaming STT
Real-time transcription