This is a simple HTTP service that uses the Edge-TTS library to generate text-to-speech audio files.
- Clone this repository
- Install the required dependencies using
pip install -r requirements.txt
- Run the server using
python main.py
Generates an audio file from the provided text and voice, and returns it as a response.
{
"text": "Hello, world!",
"voice": "en-US-GuyNeural",
"file_name": "output.mp3"
}
text
(required): The text to be converted to speech.voice
(optional): The name of the voice to use for the conversion. Defaults to "zh-CN-YunxiNeural".file_name
(optional): The name of the output file. Defaults to "test.mp3".
The generated audio file will be returned as a response with the content type "audio/mpeg".
Streams the generated audio file as a response.
{
"text": "Hello, world!",
"voice": "en-US-GuyNeural"
}
text
(required): The text to be converted to speech.voice
(optional): The name of the voice to use for the conversion. Defaults to "zh-CN-YunxiNeural".
The generated audio file will be streamed as a response with the content type "application/octet-stream".