generate_audio gains output_path + format params (wav, mp3, ogg, flac, m4a). Non-wav formats route through ffmpeg (added to the Dockerfile). Files land under /output/ inside the container, bind-mounted from the host's TTS_OUTPUT_HOST_DIR (defaults to ~/mcspeak-out). Subdirectories are auto-created. Path validation rejects writes outside /output/ — both absolute escapes like /etc/passwd and traversal forms like ../../etc/passwd are canonicalized and checked against the mount root. Extension auto-corrects to match the requested format. piper-tts service added to compose using rhasspy/wyoming-piper. Default voice es_MX-ald-medium is pre-warmed at container start and persists in ./piper-data/ across recreates (~60 MB download on first run). Port 10200 published to localhost so host-side scripts can also reach Wyoming directly; mcspeak inside the stack uses container DNS. Voice configurable via TTS_PIPER_VOICE — the same env var threads through to both wyoming-piper's --voice flag and mcspeak's settings.piper_voice, so they stay in sync. PiperEngine.__init__ accepts a default_voice override; settings.piper_voice threads it from the env. list_engines now reports the configured default rather than the hardcoded en_US-lessac-medium. speak() / generate_audio() calls with engine=piper and no explicit voice use the configured one. mcspeak-internal network changed from internal:true to default-bridge. internal:true was overkill — the goal was per-stack DNS scoping (which compose provides automatically via the project-prefixed network name), not internet isolation. The latter broke piper-tts's HuggingFace voice download with "Name resolution failure" on first start. .gitignore: add piper-data/ so the downloaded voice models stay out of the repo.
25 lines
1.3 KiB
Plaintext
25 lines
1.3 KiB
Plaintext
# Compose project namespace -- prevents collisions with other stacks
|
|
COMPOSE_PROJECT=mcspeak
|
|
|
|
# Host directory for generate_audio output (output_path / format params).
|
|
# Mounted as /output inside the container. Defaults to ~/mcspeak-out when unset.
|
|
# TTS_OUTPUT_HOST_DIR=/home/you/audio-out
|
|
|
|
# Default Piper voice to pre-warm at piper-tts container start. Other voices
|
|
# requested via the speak() voice= param are downloaded on demand. Full list:
|
|
# https://github.com/rhasspy/piper/blob/master/VOICES.md
|
|
# TTS_PIPER_VOICE=es_MX-ald-medium
|
|
|
|
# Path to Orpheus GGUF model file (required by llama-server service)
|
|
# Tip: if you've already pulled it via Ollama, find the blob with:
|
|
# ollama show --modelfile orpheus | grep FROM
|
|
ORPHEUS_GGUF_PATH=/path/to/orpheus.gguf
|
|
|
|
# Optional overrides -- see README "Configuration" for the full list
|
|
# TTS_ENTRY_TONE=chirp # chirp | apollo | none | /path/to.wav
|
|
# TTS_EXIT_TONE=roger # roger | quindar-out | none | /path/to.wav
|
|
# TTS_CANCEL_TONE=scratch # scratch | reverse-roger | none | /path/to.wav
|
|
# TTS_DUCK_MEDIA=true # fade host audio while speaking
|
|
# TTS_VOICE_IDENTITY=true # auto-assign distinct voices per project
|
|
# TTS_SHUTDOWN_TIMEOUT=30 # max seconds to wait for current speech on stop
|