Skip to content

Commit ca5cfa5

Browse files
authored
added comments in code
1 parent 29cdc89 commit ca5cfa5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Diff for: AutomationScripts/Speech Recognizer/speech_recognizer.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
import pyttsx3
1+
# pip install SpeechRecognition
22
import speech_recognition as sr
3+
# pip install pyttsx3
4+
import pyttsx3
35

4-
6+
# creating object
57
engine = pyttsx3.init()
68

7-
9+
# function for speaking up the recognized voice through speakers
810
def fun_talk(audio):
911
engine.say(audio)
1012
engine.runAndWait()
1113

12-
14+
# function for taking the voice commands and recognizing it
1315
def get_command():
1416

1517
rec = sr.Recognizer()
@@ -37,4 +39,5 @@ def get_command():
3739

3840
if 1:
3941

42+
# taking the input as voice command from the user
4043
query = get_command().lower()

0 commit comments

Comments
 (0)