text to speech free software code example
Example 1: text to speech
import pyttsx3
engine = pyttsx3.init()
engine.say("")
engine.runAndWait()
Example 2: text to speech online
import pyttsx3
engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
print(voices)
engine.setProperty('voices', voices[0].id)
def speak(audio):
print(audio)
engine.say(audio)
engine.runAndWait()
speak('Hello')
Example 3: text to speech
import pyttsx3
engine = pyttsx3.init()
engine.say("write here what you want to speak")
engine.runAndWait()