The Rust implementation provides a robust server capable of processing multiple streaming queries in parallel via websockets. It is recommended for production environments.
Installation:
Installing the Rust server is complex because it relies on the Python implementation. It is recommended to use the start_tts.sh script from the unmute repository to ensure all Python dependencies are correctly installed. If you have a broken installation, run cargo uninstall moshi-server before reinstalling.
Starting the Server:
Run the server using the provided configuration file:
moshi-server worker --config configs/config-tts.toml
Connecting to the Server:
Once the server is running, use the tts_rust_server.py script to interact with it:
# From stdin, plays audio immediately
echo "Hey, how are you?" | python scripts/tts_rust_server.py - -
# From text file to audio file
python scripts/tts_rust_server.py text_to_say.txt audio_output.wav
Configuration:
Modify configs/config-tts.toml to adjust server settings. Refer to the comments within the file for available options.