nateshmbhat / pyttsx3

Offline Text To Speech synthesis for python
Mozilla Public License 2.0
2.11k stars 331 forks source link

Pyttsx3 can work on heroku? #228

Closed sekpona1-crypto closed 1 day ago

sekpona1-crypto commented 2 years ago

Hello every one. My problem is to know if pyttsx3 can work as heroku app or can be deploy as cloud app? And if we can create tts api whith it. Because pyttsx3 use our local machine voice. Where can it found voices on cloud? Is another way to install these voices? Please help me. (Sorry for my english. I'm french")

maskill commented 2 years ago

Hi, hopefully this maybe useful to you or anyone else. Assuming heroku can import the pyttsx3 module it may be possible to save the audio as an .mp3 file server-side. After that the file can be sent to the client and played using a default media player.

Documentation

import pyttsx3 engine = pyttsx3.init() engine.save_to_file('Hello World' , 'test.mp3') engine.runAndWait()

This thread may be helpful with finding and installing new voices.

willwade commented 1 day ago

Just an update to anyone. It should technically as long as espeak installed on the runner. Like @maskill says use save to file. I’d actually suggest though using a diff voice engine. Take a look at https://github.com/willwade/tts-wrapper and the bytestream methods. I guess if I finish #333 that would be useful in this scenario too.