Skip to main content
transcribe() is a suspend extension function on RunAnywhere. It takes raw audio bytes and returns an STTOutput, not a bare String.
Signature:
There is no transcribeWithOptions; transcribe() always takes options and always returns the detailed output. RASTTOptions is a typealias for the generated ai.runanywhere.proto.v1.STTOptions, and RASTTOutput for STTOutput. Audio must be 16 kHz mono 16-bit PCM.

Model loading

There is one load entry point for every modality. Category is optional and only needed to disambiguate a model registered under more than one:
loadModel returns a ModelLoadResult with a success flag rather than throwing:
To see what is currently loaded for speech recognition:

STTOutput

WordTimestamp carries word, start_ms, end_ms, confidence, and speaker_id. All timings are milliseconds, as Long.
TranscriptionMetadata carries model_id, processing_time_ms, audio_length_ms, and real_time_factor. A real-time factor below 1.0 means transcription ran faster than the audio plays.
Both are nullable-safe reads because metadata is an optional message and either field can be 0 when the backend does not report it.

Transcribing a file

The file has to contain 16 kHz mono 16-bit PCM samples. Decode or resample anything else before calling.

Errors

transcribe() throws SDKException when the SDK is not initialized or when no speech-recognition model is loaded. See Error handling.

Streaming STT

Live microphone transcription

STT options

Every field on STTOptions