Edit model card


OpenSpeech TTS API

A simple and effective Text-to-Speech API compatible with OpenAI's endpoint
Explore the docs »

View Demo · Report Bug · About The Project

OpenSpeech TTS is a user-friendly and efficient Text-to-Speech (TTS) API designed to seamlessly integrate with OpenAI's powerful text-to-speech capabilities. This project aims to provide developers with a simple and effective tool to convert text into natural-sounding speech, making it ideal for various applications such as voice assistants, audiobooks, and accessibility tools.

Key Features:

Compatibility with OpenAI's API: Leverages OpenAI's advanced text-to-speech models to deliver high-quality audio output. Ease of Use: Provides a straightforward interface for developers to integrate TTS functionality into their projects. Efficiency: Optimized for performance to ensure smooth and responsive TTS generation. No need for GPU.

(back to top)

Built With

We used Python + Flask + Gevent WSGI for depolyment and Edge TTS for the TTS support.

(back to top)

Getting Started

This is how you will succesfully run your OpenSpeech TTS Server:

Prerequisites

This is an example of how to list things you need to use the software and how to install them. Python 3.10 + above with the following libarires in a virtual environment:

pip install Flask
pip install edge-tts
pip install cryptography
pip install gevent
pip install art

Installation

Below is a step by step installation guide to run succesfuly the TTS Server.

  1. Clone the repo
    git clone https://github.com/github_username/repo_name.git
    
  2. Create & Activate a Virtual Environment in Python
    python -m venv /path/to/new/virtual/environment
    source <venv>/bin/activate
    
  3. Run the api.py python
    cd ./openspeech-tts/main
    python api.py
    
  4. When prompted, enter the desired API key that you want to access the server & the Port to forward the API
    Enter API Key: ....
    Enter Port: ....
    
  5. The server is up and ready to run!

(back to top)

Usage

You can use the TTS API in the same way you use the OpenAI Text-to-Speech:

    curl http://localhost:5000/v1/audio/speech \
      -H "Authorization: Bearer API-KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "tts-1",
        "input": "Today is a wonderful day to build something people love!",
        "voice": "alloy"
      }' \
      --output speech.mp3

For the request example, please refer to the Sample Request Curl

(back to top)

Roadmap

  • Add Changelog
  • Add main api.py file
  • Add Additional Examples
  • Adding secure https connection
  • Adding more endpoints from OpenAI API
    • v1/audio/translations
    • v1/audio/transcriptions

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b PantelisDeveloping/openspeech-tts)
  3. Commit your Changes (git commit -m 'Committing changes')
  4. Push to the Branch (git push origin PantelisDeveloping/openspeech-tts)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Pantelis

Project Link: https://github.com/PantelisDeveloping/openspeech-tts

(back to top)

--- license: apache-2.0 ---
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Examples
Unable to determine this model's library. Check the docs .