Last active
December 14, 2020 09:20
-
-
Save Abhayparashar31/4a8ab6114135807405a6c0968e0a3302 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import speech_recognition as sr | |
| def command(): | |
| r = sr.Recognizer() | |
| with sr.Microphone() as source: | |
| print("Alexa: Listening...") | |
| audio=r.listen(source) | |
| try: | |
| query = r.recognize_google(audio) | |
| print(f"master:{query}") | |
| return query | |
| except: | |
| print("Try Again") | |
| ## print(command()) ## uncomment this to test the function ### Run the code and speak anything and it will printed on the screen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment