Expand description
The in-process Kokoro-82M engine.
Re-exportsยง
use std::sync::Mutex;๐use std::sync::mpsc;๐use tokio::sync::mpsc as tokio_mpsc;๐use crate::model::ModelFiles;๐use crate::Chunk;๐use crate::Engine;๐use crate::Error;๐use crate::SpeakRequest;๐
Structsยง
- Job ๐
- Kokoro ๐
- The loaded engine, as the wire conversion sees it.
- Kokoro
Tts - A loaded Kokoro-82M pipeline. One render thread per engine, so a second utterance queues behind the first; the thread owns the ONNX session and the runtime the engineโs async API needs.
Constantsยง
- DEFAULT_
VOICE - The voice an utterance renders in when the request names none.
- SAMPLE_
RATE - The wireโs sample rate: 24 kHz mono 16-bit. Kokoro renders at this rate natively; anything else is resampled once, here.
Traitsยง
- Renderer ๐
- What the engineโs inference looks like to the wire conversion, so a test can drive the conversion with no model load.
Functionsยง
- chunk_
for ๐ - One render: the voice the request names, the modelโs samples, and the wireโs own shape.
- pcm16 ๐
- The wireโs sample: clamp to [-1, 1], then the signed 16-bit range.
- refused ๐
- A channel carrying one failure, for a render thread that is gone.
- resample ๐
- Linear resampling to the wire rate; identity when the rates match.
- select_
voice - The installed voices a request is checked against.