Alice-TTS is a text-to-speech (TTS) module of the AliceAI project, Alice-TTS has many modules inside itself but as of now, it's only leveraging the Edge TTS engine. It provides RESTful APIs to generate and stream TTS audio with customizable parameters like speech rate and volume.
- Generate TTS Audio: Convert text to speech and return the audio file.
- Stream TTS Audio: Stream the TTS audio in real-time.
- Customizable Speech: Adjust speech rate and volume (e.g.,
"-50%"
,"+20%"
).
-
Clone the repository:
git clone https://github.com/yourusername/alice-tts.git cd alice-tts
-
Build and run:
cd docker docker-compose up --build
-
Access: The API will be available at
http://localhost:5500
.
-
Install dependencies:
pip install -r requirements.txt
-
Run the app:
python main.py
-
Access: The API will be available at
http://localhost:5500
.
Convert text to speech and download the audio.
curl -X POST "http://localhost:5500/edgetts/gen" \
-H "Content-Type: application/json" \
-d '{"message": "Hello World!", "voice": "en-GB-SoniaNeural"}' \
--output output.mp3
Stream TTS audio without downloading the full file.
curl -X POST "http://localhost:5500/edgetts/stream" \
-H "Content-Type: application/json" \
-d '{"message": "Hello World!", "voice": "en-GB-SoniaNeural"}' \
--output output.mp3
rate
: Speed adjustment (e.g.,"-50%"
,"+20%"
).volume
: Volume adjustment (e.g.,"-50%"
,"+20%"
).