Skip to content

TTS-Translator is a Docker image that contains an API for translating text and converting text to speech. It also provides the functionality to combine both actions to provide text-to-speech translation.

License

Notifications You must be signed in to change notification settings

tmcx/tts-translator

Repository files navigation

Description

TTS-Translator is a Docker image that contains an API for translating text and converting text to speech. It also provides the functionality to combine both actions to provide text-to-speech translation.

Environment Variables

  • LT_LOAD_ONLY: Defines the languages to be installed. Example: "en,es"
  • API_PORT: Defines the port of the API. Example: "8080"

Features

  • Text translation.
  • Text-to-speech conversion.
  • Text-to-speech translation.

Endpoints

  • POST /tts: Translates and/or transforms to text-to-speech.
    • HTTP Body:
    {
        "text": "Hello world!",           // [Required] Text to use
        "voice": {                        // [Optional] Voice configuration
            "name" : "es-AR-TomasNeural", // TTS voice. To list it use /tts/voices endpoint.
            "volume": -50,                 // Voice volume
            "pitch": -10,                 // Voice pitch
            "rate": -10                   // Voice rate
        },
        "translate": {                    // [Optional] Translation configuration
            "from": "en",                 // Source language
            "to": "es"                    // Target language
        }
    }
  • GET /tts/voices: Retrieves the voices available for text-to-speech.
  • POST /translate: Translates text.
    • HTTP Body:
    {
        "text": "Hello world!",           // [Required] Text to use
        "from": "en",                     // [Required] Source language. To list it use /translate/languages endpoint.
        "to": "es"                        // [Required] Target language. To list it use /translate/languages endpoint.
    }
  • GET /translate/languages: Retrieves the languages available for translate.

Usage

To run this Docker image, you can use the following command:

docker run -d -e LT_LOAD_ONLY="en,es" -e API_PORT="8080" -p 8080:8080 tmcx/tts-translator:latest

Author

TMCX

Repository

The source code of this project is available on GitHub.

License

This project is licensed under the LGPL-3 License for commercial use without the obligation to share the source code.

About

TTS-Translator is a Docker image that contains an API for translating text and converting text to speech. It also provides the functionality to combine both actions to provide text-to-speech translation.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published