We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 29cdc89 commit ca5cfa5Copy full SHA for ca5cfa5
AutomationScripts/Speech Recognizer/speech_recognizer.py
@@ -1,15 +1,17 @@
1
-import pyttsx3
+# pip install SpeechRecognition
2
import speech_recognition as sr
3
+# pip install pyttsx3
4
+import pyttsx3
5
-
6
+# creating object
7
engine = pyttsx3.init()
8
9
+# function for speaking up the recognized voice through speakers
10
def fun_talk(audio):
11
engine.say(audio)
12
engine.runAndWait()
13
14
+# function for taking the voice commands and recognizing it
15
def get_command():
16
17
rec = sr.Recognizer()
@@ -37,4 +39,5 @@ def get_command():
37
39
38
40
if 1:
41
42
+ # taking the input as voice command from the user
43
query = get_command().lower()
0 commit comments