Skip to main content
Early Beta — The Web SDK is in early beta. APIs may change between releases.

Overview

RunAnywhere.transcribe() runs one-shot speech recognition against the STT model currently held by the SDK’s model lifecycle. Everything runs in the browser through the sherpa-onnx WASM build in @runanywhere/web-onnx. There is no separate STT model loader. You register a model, download it, and load it through the same lifecycle used by every other modality, then call transcribe.

Prerequisites

Without a registered ONNX backend, STT calls fail with ERROR_CODE_FEATURE_NOT_AVAILABLE. See Configuration for how catalog entries are registered.

Basic usage

Signature

audio accepts either form. A Float32Array of normalized samples in the range -1.0 to 1.0 is encoded to little-endian Int16 PCM by the SDK; a Uint8Array is passed through as PCM16 bytes already. TranscribeOptions is Partial<STTOptions>.

Audio requirements

AudioCapture from @runanywhere/web/browser defaults to 16 kHz mono, so its chunks feed straight into transcribe.

Options

STTOptions comes from idl/stt_options.proto. Defaults:

Result

Transcribe from the microphone

AudioCapture accumulates every chunk internally. getAudioBuffer() returns a copy, drainBuffer() returns it and clears, and clearBuffer() discards.

Transcribe an uploaded file

AudioFileLoader.toFloat32Array(file, targetSampleRate = 16000) decodes anything the browser’s AudioContext supports (wav, mp3, m4a, ogg, flac, aac, opus, webm), mixes to mono, and resamples. It returns { samples, sampleRate, durationSeconds }.

Error handling

Streaming STT

Partial results while the user speaks

STT options

Models and configuration

VAD

Voice activity detection

Voice agent

Full voice turn