Text to Speech (TTS)¶
Enable TTS¶
ask --tts "summarize this"
Modes¶
Full mode¶
Speaks after full model response is complete:
ask --tts --tts-configure full "explain this"
Stream mode¶
Speaks while tokens are being generated:
ask --tts --tts-configure stream "read this while generating"
Runtime Requirements¶
piperexecutable onPATHaplayexecutable onPATH- valid Piper model file
Default model path:
~/.local/share/piper/en_US-lessac-medium.onnx
Relevant Environment Variables¶
ASK_TTS_MODELASK_TTS_SAMPLE_RATEASK_TTS_MODEASK_TTS_DELAY_SECONDS(buffer delay, clamped to ~100-300ms)
Implementation Notes¶
Current streaming behavior includes:
- small delay buffer for smoother cadence
- tiny chunk merging to reduce choppiness
- flush on Piper stdin after each chunk
- Ctrl+C interrupt support for immediate stop
- lock-based protection against overlapping audio playback