SpekoSTT is a stt.STT implementation. It encodes each utterance’s audio frames into a WAV payload and uploads it to the Speko proxy. The router picks the best STT provider for your (language, vertical, optimizeFor) and handles failover.
Constructor
SpekoSTTOptions
| Field | Type | Required | Description |
|---|---|---|---|
speko | Speko | ✅ | @spekoai/sdk client. |
intent | Intent | ✅ | Validated at construction time. |
constraints | PipelineConstraints? | Allow-list constraints passed on every call. |
validateIntent(intent) — a broken routing hint throws here rather than deep inside the first transcription.
Properties
label = 'speko.STT'provider = 'speko'model = 'speko-router'streaming = false,interimResults = false
Streaming requirement
SpekoSTT.stream() throws. The Speko proxy is buffered, so native streaming isn’t possible. Wrap the instance:
createSpekoComponents which does this for you.
Per-utterance flow
StreamAdapter+ VAD segment the user’s audio into utterances.SpekoSTT._recognize(frame, abortSignal)is invoked for each utterance.- Frames are combined (
combineAudioFrames) and encoded into PCM16 mono WAV viaframesToWav. - The WAV is uploaded via
speko.transcribe()with the intent header and anyconstraints. - The result is emitted as a single
FINAL_TRANSCRIPTevent with confidence defaulting to1when the upstream provider doesn’t report one.
AbortSignal passed by StreamAdapter cancels the in-flight HTTP request.
Mono-only
Multi-channel audio throws at the WAV-encode step:AgentSession to pass mono audio, or pre-mix upstream.