Skip to main content

Crate pipecrab_tts

Crate pipecrab_tts 

Source
Expand description

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

Synthesizer is the swappable TTS capability the conversation loop drives: text in, audio out incrementally — every stream item is a preemption point, so a barge-in Interrupt can stop playback within a single chunk. Concrete engines stay behind it, so the pipeline never names one.

TtsStage adapts any Synthesizer into a pipeline Stage: on a final agent Transcript it synthesizes the text and streams Audio chunks in its place; every other frame passes through untouched.

SentenceChunker is the low-latency feeder that sits upstream of TtsStage: it splits a streaming agent generation into one final agent Transcript per sentence, so synthesis of the first sentence can begin before the model has finished the last. This is why a Final agent transcript is documented as a generation unit that may in practice be a single sentence.

Platform-neutral and wasm32-checkable: the concrete engines live elsewhere (a native engine, a browser engine 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§

EmitSentence
One completed sentence to forward as a final agent transcript: SentenceChunker’s Processor::Effect. Emitted by decide_data, interpreted by perform. Its inner text is private — only the chunker constructs one.
SentenceChunker
Adapts a streaming agent generation into per-sentence final transcripts.
Speak
One piece of text to synthesize: TtsStage’s Processor::Effect. Emitted by decide_data, interpreted by perform. Its inner text is private — only the stage constructs one.
TtsStage
Adapts any Synthesizer into a pipeline Stage: on a final agent Transcript it synthesizes the text and streams Audio chunks in its place; every other frame passes through untouched.

Enums§

TtsError
Why a Synthesizer::synthesize call failed.

Traits§

Synthesizer
The swappable text-to-speech capability: text in, audio out incrementally.

Type Aliases§

TtsAudioStream
The audio a Synthesizer::synthesize call yields: a boxed stream of AudioChunk results, delivered incrementally.