From 8f46e55b58ee87481c696d2bc3f13e91ebf9d596 Mon Sep 17 00:00:00 2001 From: Abhilash Date: Mon, 21 Apr 2025 19:36:43 +0530 Subject: [PATCH] Added offline text to speech --- SpeechToText.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 SpeechToText.py diff --git a/SpeechToText.py b/SpeechToText.py new file mode 100644 index 00000000000..12ee402667a --- /dev/null +++ b/SpeechToText.py @@ -0,0 +1,14 @@ +import pyttsx3 + +engine = pyttsx3.init() + +voices = engine.getProperty("voices") +for voice in voices: + print(voice.id) + print(voice.name) + +id ="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_EN-US_DAVID_11.0" +engine.setProperty("voices",id ) +engine.setProperty("rate",165) +engine.say("jarivs") # Replace string with our own text +engine.runAndWait() \ No newline at end of file