Local text-to-speech using tiny-voca
(4.5M parameters, Apache-2.0) running on ONNX Runtime via OnnxRuntime.
No API key or external runtime is needed. On first use, the ONNX model
(onnx/model.onnx, ~21.4 MB) and dizione phonemizer data (~5.4 MB) are
downloaded from Hugging Face into the local cache directory and kept in
:persistent_term.
Built-in American English voices: "F2" (female, default) and "M2" (male).
Native audio is 24 kHz mono s16le PCM; other :sample_rate values are
resampled with Octoroom.Agent.Audio.PCM16.resample/3.
{:ok, pcm} = Octoroom.Agent.TTS.synthesize("tiny_voca:tiny-voca", "Hello!", voice: "M2")Besides Octoroom.Agent.TTS's options (:model, :voice, :sample_rate),
it takes:
:speed- speaking rate multiplier (default1.0; larger is faster):pitch_shift- added to log F0 (default0.0;0.058≈ one semitone):pitch_range- scales pitch movement around the mean (default1.0):model_dir- directory holdingonnx/model.onnxandphonemizer/(defaults toTINY_VOCA_DIR,:octoroom_agents's:tiny_voca_dir, or the OS user cache directory):download- download missing weights from Hugging Face on demand (defaulttrue):overrides-%{word => pronunciation}map of inline dictionary overrides (CMUdict ARPAbet or narrow IPA)
Summary
Functions
Ensures the model and phonemizer are downloaded and loaded into
:persistent_term so the first spoken turn has no cold-load delay.