pyttsx3
pyttsx3 copied to clipboard
Overwriting a given output file
Could someone tell me if it is possible to overwrite a given output file? ` import pyttsx3 as audio
player = audio.init() player.save_to_file("Hello", "test.mp3") player.save_to_file("How are you?", "test.mp3") player.runAndWait() ` In the example shown above, even though I am using save_to_file twice, the test.mp3 only plays "Hello" (i.e., the first statement is reflecting but the second isn't...
Issue-Label Bot is automatically applying the label question to this issue, with a confidence of 0.75. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
@brahmakulkarni This is an issue inside of pyttsx3, for some reason in most cases runAndWait will only run the first statement. I use the following function to help with this issue in my code. (Keep in mind, you will have to modify this for your use case)
def speak(text=None):
import pyttsx3
# Initialize the engine
engine = pyttsx3.init(driverName=None, debug=True)
# Speak
engine.say(text)
engine.runAndWait()