-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use without file/Docker issues? #151
Comments
Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details. |
Ok so it looks like this is the result of runAndWait not actually waiting. while file_name not in os.listdir(tmp_path):
socketio.sleep(1) |
Thanks, this workaround also fixes #149. |
Can anyone help find a similar fix without using socketio? Perhaps with the threading library? I'm not building a flask app. But having issues with engine.save_to_file() when giving a long string as the first arg. It appears pyttsx3 is cutting off after certain punctuation, as well as unpredictable reasons. On MacOS, using default driverName (nsss) |
@jaredkeil You should probably open a new issue since your issue sounds different enough to warrant one. |
@jaredkeil if it's the same issue I was having I think you could just implement the sleep function from the time module? from time import sleep
while file_name not in os.listdir(tmp_path):
sleep(1) |
@JWBWork Thanks for the reply. I'm a little unsure when to run engine.save_to_file() and engine.runAndWait() in relation to the above snippet? Before, during or after the while loop? Or is this an edit in the package itself? |
I ran the loop with the sleep function after calling the function to save to a file. Basically it looks like on Linux it wasn't actually waiting, so the loop does the waiting. |
@JWBWork Hay, a little late to the thread but I encountered the same problem and also fixed it by simply using sleep(). Now that it is running I have the problem that the created files have terrible (truly awful) quality, barely even pronouncing any word. |
I'm having an issue with pyttsx3 and Docker running linux. For some reason my code works locally but once I try to run it in docker I have an issue where save_to_file doesn't create a file, and doesn't throw an errror. I only get the following error once I try to read form the file.
Here is my dockerfile
I'm trying to write audio files to tmp so that I can read the file, send the bytes to my frontend web app, and then delete the file.
I explicitly create the tmp directory and grant permissions to write in the Dockerfile, and I've tested reading and writing a file to that directly - it just seems to be a problem with pyttsx3 on linux in Docker.
Is there any solution to this?
Or, even better, is there some way pyttsx3 can give me a byte array in memory or as an object? It would be nice to have options other than having the script immediatly recite the text, or write it to a file. At least be able to pass a file like object to save_to_file so I can then read that file like object instead of actually writing to a file only to immediatly delete it.
The text was updated successfully, but these errors were encountered: