Skip to main content

Crate pipecrab_stt

Crate pipecrab_stt 

Source
Expand description

pipecrab-stt: the speech-to-text interface.

StreamingTranscriber is the STT capability the conversation pipeline drives: f32 audio a window at a time in, SttEvents out — partial hypotheses while the user is still speaking, then a final transcript, which is what a low-latency conversation loop needs. Concrete models stay behind it, so the pipeline never names one.

An engine reaches that interface one of two ways:

  • A native streaming engine (e.g. a streaming Zipformer) implements StreamingTranscriber directly, emitting real partials.
  • A chunk-final engine (e.g. Moonshine) implements the simpler one-shot Transcriberf32 samples in, one transcript out, no partials — and the Buffered adapter lifts it to StreamingTranscriber by accumulating the utterance and transcribing it once at the end. So a partial-less engine still plugs into the same streaming interface, without the pipeline knowing the difference.

SttStage adapts a StreamingTranscriber into a pipeline Stage as a stateless protocol adapter.

§Format authority

Format authority flows from the party that knows the requirement, not from whatever the wire happens to carry. Stages reject fatally mismatched formats.

Platform-neutral and wasm32-checkable: the concrete engines live elsewhere (native ort, browser Transformers.js in a Web Worker), each behind these traits, so the interface itself carries no backend dependency and compiles for both the host and wasm32-unknown-unknown.

Structs§

Buffered
Fits a one-shot Transcriber to the StreamingTranscriber protocol by buffering the whole utterance and transcribing it once at the end — the adapter for chunk-final engines like Moonshine that have no partial output.
SttStage
Adapts any StreamingTranscriber into a pipeline Stage as a stateless protocol adapter.

Enums§

SttEffect
One step of the utterance protocol: SttStage’s Processor::Effect. Emitted by decide_*, interpreted by perform.
SttError
Why a Transcriber::transcribe call failed.
SttEvent
An event emitted by a StreamingTranscriber as an utterance progresses.

Traits§

StreamingTranscriber
A transcription session protocol for engines that emit partial results while audio is still arriving (e.g. a streaming Zipformer). One active utterance per engine instance.
Transcriber
The swappable speech-to-text capability: f32 samples in, a transcript out.