Contenerized text-to-speech engine based on Coqui's TTS with web API
edit | blame | history | raw

Text-to-speech API based on Coqui's TTS

Simple Python-based container with everything that is needed
to have a self-hosted web-based text-to-speech API.

Using the container

Just run:

docker run -d -p 8000:8000 ghcr.io/jacekkow/docker-text-to-speech-api-tts:master

and then visit http://localhost:8000/docs

There is a simple /sythesize endpoint that expects a JSON and returns a wave file:

curl -o result.wav -X 'POST' \
  'http://localhost:8000/synthesize' \
  -H 'Content-Type: application/json' \
  -d '{"language": "en", "text": "Sample text."}'

Adding languages

Currently only English and Polish models are included in the image.

To add additional languages you can simply add extra entries
in src/config.py file and rebuild the container.

Model identifiers are defined in the TTS repository:
https://github.com/idiap/coqui-ai-TTS/blob/dev/TTS/.models.json

Command line tts --list_models lists all the available models.

Note that the API does not support multi-speaker models yet!

edit | blame | history | raw
BSD 3-Clause License

Copyright (c) 2024 Jacek Kowalski and contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
   contributors may be used to endorse or promote products derived from
   this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
README 1 KB
requirements 73 b