Skip to content

Commit 817ebb8

Browse files
Merge pull request #2622 from LAbhilashKumar/Speech_to_text
Added offline text to speech
2 parents 27bfd0e + 8f46e55 commit 817ebb8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

SpeechToText.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import pyttsx3
2+
3+
engine = pyttsx3.init()
4+
5+
voices = engine.getProperty("voices")
6+
for voice in voices:
7+
print(voice.id)
8+
print(voice.name)
9+
10+
id ="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_EN-US_DAVID_11.0"
11+
engine.setProperty("voices",id )
12+
engine.setProperty("rate",165)
13+
engine.say("jarivs") # Replace string with our own text
14+
engine.runAndWait()

0 commit comments

Comments
 (0)