feat: add TTS support with Piper to murmure-core#11
Open
Lsh0x wants to merge 15 commits into
Open
Conversation
- Created unified murmure-core crate combining STT and TTS - Moved murmure-stt code to murmure-core/src/stt/ - Added TTS module structure following STT patterns: - TTS config and model management - SynthesisEngine trait and PiperEngine implementation - SynthesisService for file-based synthesis - SynthesisStream for streaming synthesis - Audio utilities for WAV output - Updated workspace to use murmure-core - Updated server to use new module paths - Added piper crate dependency Note: PiperEngine implementation is a placeholder structure. Actual Piper integration needs to be completed based on piper crate API. Closes enhancement-2025-11-08-add-tts-support
All code has been moved to murmure-core/src/stt/ and the workspace no longer includes murmure-stt. Removing the leftover directory.
…tions - Added TTS features to feature list - Added Piper TTS model download instructions with examples - Updated configuration section with TTS environment variables - Added Technology section explaining both STT and TTS - Updated config.json example to include TTS settings - Added links to Piper Voices Repository
- Updated README to use resources/stt/ for STT models - Updated README to use resources/tts/ for TTS models - Updated STT config to look in resources/stt/ (with legacy path fallback) - Updated TTS config to look in resources/tts/ (with legacy path fallback) - Updated all examples and documentation references
- Added murmure-core dependency to examples - Updated rust_record_client to synthesize and play audio after STT - Updated rust_streaming_client to synthesize and play audio after STT - Added play_wav_bytes function using cpal for audio playback - TTS is optional and fails gracefully if not configured
- Added SynthesisService to proto/murmure.proto with SynthesizeText and SynthesizeStream RPCs - Implemented SynthesisServiceImpl in murmure-server - Registered TTS service in server main.rs (optional, fails gracefully if not configured) - Updated rust_record_client to use gRPC TTS instead of direct library calls - Updated rust_streaming_client to use gRPC TTS instead of direct library calls - Fixed mutable reference issue for TTS gRPC client
- Added STT configuration (resources/stt/) - Added TTS configuration (resources/tts/) - Added server configuration - Includes comments explaining each variable
- Replaced incorrect 'piper' crate (pipe library) with 'piper-tts-rust' (TTS library) - Implemented actual model loading using Model::new() with .onnx and .json paths - Implemented synthesize_text using process_ipa_string method - Fixed sample rate type conversion (u64 to u32) - Model now generates actual audio samples instead of empty vectors
- Add debug logs to track TTS config loading - Add debug logs for TTS service registration - Helps diagnose why TTS service might not be available
- Downloaded en_US-lessac-medium.onnx (60MB) - Downloaded en_US-lessac-medium.onnx.json (4.8KB) - Replaced placeholder files with actual model files
4c11e75 to
3415b13
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Added Text-To-Speech (TTS) support using Piper to the Murmure project. Created a unified
murmure-corecrate that combines both STT and TTS functionality, following the same architectural patterns as the existing STT code.Changes
Structure
murmure-core/crate combining STT and TTSmurmure-stt/code tomurmure-core/src/stt/murmure-core/src/tts/module with complete TTS structureTTS Implementation
TtsConfigwith model path, sample rate, speaker IDTtsModelfor model management (mirrors STT's Model)SynthesisEnginetrait andPiperEngineimplementationSynthesisServicefor file-based text-to-audio synthesisSynthesisStreamfor streaming/incremental synthesisIntegration
Cargo.tomlto usemurmure-coreImplementation Status
✅ Complete:
PiperEngineVerification
cargo build --workspacecargo clippy --workspacecargo fmt --allNext Steps
Related
Closes enhancement-2025-11-08-add-tts-support