Git Product home page Git Product logo

text2speech-flask-api's Introduction

Text-To-Speech API

A Text-To-Speech (TTS) API implemented using Flask. This repository provides a Docker setup to easily get up and running.

Table of Contents

Prerequisites

Setup

  1. Clone this repository:
    git clone <repository-url>
    cd <repository-dir>
  2. IMPORTANT - Set the API_KEY enviroment variable, this helps to prevent your API from unauthorized ussage. You can use any UUID online generator for this, like this UUID Generator:
    export API_KEY=value
    
  3. Build and start the Docker containers
    docker-compose up --build -d
    
    If you are running with sudo. You should run the below, otherwise it can not load the env variable:
    sudo -E docker-compose up --build -d
    

Note: If you want to change the API_KEY for any reason:

1. SSH to your server
2. sudo docker-compose stop
3. export API_KEY=new_value
4. sudo -E docker-compose up --build -d

Ussage

To use the TTS API, make a POST request to the API endpoint with the text you want to convert:

  • rate is the reading speed. Its value range is [-100, 100]
  • volume is the voice volume in the output file. Its value range is [-100,100]
  • voice is the the voice in the output file. You can check for more voices in the file voice_list.txt
curl --location 'https://yourdomain.com/tts' \
--header 'x-api-key: sample_api_key' \
--header 'Content-Type: application/json' \
--data '{
    "text": "Hello world, this is a test",
    "voice": "en-US-ChristopherNeural",   
    "rate": 20,
    "volume": -50
}'

text2speech-flask-api's People

Contributors

phatdangx avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.