Skip to main content
The STTOptions struct allows you to customize speech-to-text behavior including language, timestamps, and audio format.

STTOptions

Parameters

Language Support

Whisper models support 99 languages. Common language codes:

Auto-Detection

Leave language unspecified or set to empty string for auto-detection:

Force Language

Word Timestamps

Enable word-level timing for subtitles, karaoke, or word highlighting:

WordTimestamp Structure

Subtitle Generation Example

Voice Activity Detection (VAD)

VAD filters out silent segments before transcription:
Enable VAD for real-time transcription to reduce processing time and improve accuracy by ignoring silence.

Sample Rate

The SDK expects audio at 16kHz by default. If your audio has a different sample rate, specify it:
For best results, record audio at 16kHz mono. While the SDK can resample, native 16kHz audio produces better accuracy.

TranscriptionMetadata

Get information about the transcription process:

Alternative Transcriptions

Access alternative interpretations:

Complete Example

transcribe()

Basic transcription →

Streaming STT

Real-time transcription →