File size: 5,030 Bytes
85618d4
 
 
 
 
 
 
 
 
6199a22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85618d4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
---
license: apache-2.0
language:
- en
pipeline_tag: text-to-speech
tags:
- TTS
- Text-To-Speech
---
<!-- Improved compatibility of back to top-->
<a id="readme-top"></a>
<!-- PROJECT LOGO -->
<br />
<div align="left">
    
  <h3 align="center">OpenSpeech TTS API</h3>

  <p align="center">
    A simple and effective Text-to-Speech API compatible with OpenAI's endpoint
    <br />
    <a href="https://github.com/PantelisDeveloping"><strong>Explore the docs »</strong></a>
    <br />
    <br />
    <a href="https://github.com/PantelisDeveloping">View Demo</a>
    ·
    <a href="https://github.com/PantelisDeveloping">Report Bug</a>
    ·
    <a href="https://github.com/PantelisDeveloping>Request Feature</a>
  </p>
</div>

<!-- ABOUT THE PROJECT -->
## 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.

<p align="right">(<a href="#readme-top">back to top</a>)</p>



### Built With

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

<p align="right">(<a href="#readme-top">back to top</a>)</p>



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

<p align="right">(<a href="#readme-top">back to top</a>)</p>



<!-- USAGE EXAMPLES -->
## Usage

You can use the TTS API in the same way you use the OpenAI Text-to-Speech:
```sh
    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](https://example.com)_

<p align="right">(<a href="#readme-top">back to top</a>)</p>



<!-- ROADMAP -->
## Roadmap

- [x] Add Changelog
- [x] 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](https://github.com/PantelisDeveloping/openspeech-tts/) for a full list of proposed features (and known issues).

<p align="right">(<a href="#readme-top">back to top</a>)</p>



<!-- CONTRIBUTING -->
## 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 -->
## License

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

<p align="right">(<a href="#readme-top">back to top</a>)</p>



<!-- CONTACT -->
## Contact

Pantelis

Project Link: [https://github.com/PantelisDeveloping/openspeech-tts](https://github.com/PantelisDeveloping/openspeech-tts)

<p align="right">(<a href="#readme-top">back to top</a>)</p>
---
license: apache-2.0
---