diff --git a/text_to_speech.py b/text_to_speech.py new file mode 100644 index 0000000..369c9bc --- /dev/null +++ b/text_to_speech.py @@ -0,0 +1,13 @@ +import pyttsx3 +default_SpeechRate= 176 +engine = pyttsx3.init() +voices = engine.getProperty("voices") +for voice in voices: + print(voice.id) + print(voice.name) + +desired_voice_id = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_EN-US_DAVID_11.0" +engine.setProperty(voice, desired_voice_id) +engine.setProperty("rate",default_SpeechRate) +engine.say("hello world") +engine.runAndWait()