Skip to content

feat: add TTS support with Piper to murmure-core#11

Open
Lsh0x wants to merge 15 commits into
mainfrom
feature/add-tts-support
Open

feat: add TTS support with Piper to murmure-core#11
Lsh0x wants to merge 15 commits into
mainfrom
feature/add-tts-support

Conversation

@Lsh0x
Copy link
Copy Markdown
Owner

@Lsh0x Lsh0x commented Nov 8, 2025

Summary

Added Text-To-Speech (TTS) support using Piper to the Murmure project. Created a unified murmure-core crate that combines both STT and TTS functionality, following the same architectural patterns as the existing STT code.

Changes

Structure

  • Created murmure-core/ crate combining STT and TTS
  • Moved murmure-stt/ code to murmure-core/src/stt/
  • Added murmure-core/src/tts/ module with complete TTS structure

TTS Implementation

  • Config: TtsConfig with model path, sample rate, speaker ID
  • Model: TtsModel for model management (mirrors STT's Model)
  • Engine: SynthesisEngine trait and PiperEngine implementation
  • Service: SynthesisService for file-based text-to-audio synthesis
  • Stream: SynthesisStream for streaming/incremental synthesis
  • Audio: WAV file writing utilities

Integration

  • Updated workspace Cargo.toml to use murmure-core
  • Updated server dependencies and imports
  • All STT functionality preserved and working

Implementation Status

Complete:

  • Module structure and architecture
  • Configuration and model management
  • Service and streaming APIs
  • Audio utilities
  • Build system integration

⚠️ Needs Completion:

  • Actual Piper crate API integration in PiperEngine
  • Currently uses placeholder implementation
  • Requires understanding of piper crate v0.2.4 API

Verification

  • ✅ Build passes: cargo build --workspace
  • ✅ Clippy passes: cargo clippy --workspace
  • ✅ Formatter passes: cargo fmt --all
  • ✅ STT functionality verified (server builds and imports work)

Next Steps

  1. Complete PiperEngine implementation with actual piper crate API
  2. Test with actual Piper TTS models
  3. Add gRPC endpoints for TTS (separate issue)
  4. Add usage examples and documentation

Related

Closes enhancement-2025-11-08-add-tts-support

Lsh0x added 15 commits November 8, 2025 08:02
- 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
@Lsh0x Lsh0x force-pushed the feature/add-tts-support branch from 4c11e75 to 3415b13 Compare November 8, 2025 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant