nateshmbhat / pyttsx3

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

save_to_file() does not work with long text #149

Open Epicalert opened 3 years ago

Epicalert commented 3 years ago

Running this code does not result in an output file.

import pyttsx3

tts = pyttsx3.init()

tts.save_to_file("eSpeakNG is a compact, open-source, software speech synthesizer for Linux, Windows, and other platforms. It uses a formant synthesis method, providing many languages in a small size. Much of the programming for eSpeakNG's language support is done using rule files with feedback from native speakers. Because of its small size and many languages, it is included as the default speech synthesizer in the NVDA open source screen reader for Windows, as well as Android, Ubuntu and other Linux distributions. Its predecessor eSpeak was recommended by Microsoft in 2016 and was used by Google Translate for 27 languages in 2010; 17 of these were subsequently replaced by commercial voices. The quality of the language voices varies greatly. In eSpeakNG's predecessor eSpeak, the initial version of each language was based on information found on Wikipedia. Some languages have had more work or feedback from native speakers than others.","testfile.ogg")
tts.runAndWait()

But with shorter input text, it works fine.

import pyttsx3

tts = pyttsx3.init()

tts.save_to_file("eSpeakNG is a compact, open-source, software speech synthesizer for Linux, Windows, and other platforms.","testfile.ogg")
tts.runAndWait()

Tested with espeak 1.48.03 and espeak NG 1.50 (with symlink) on Arch Linux with Python 3.8.5.

issue-label-bot[bot] commented 3 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.81. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

thanhtoan1196 commented 2 years ago

any update?

efeakaroz13 commented 1 year ago

Same issue, but you can try to change the voice

shawnCaza commented 1 year ago

On a mac, using 2.9. The long string produce an output file up to the end of the first sentence.

No matter how long the string is, I cannot save more than one sentence to a file.

prince-esmagico commented 2 months ago

I am having the same issues . Any updates