Created
October 1, 2019 20:00
-
-
Save MayankFawkes/64917680653e2b4a010e45d75c0387bd to your computer and use it in GitHub Desktop.
lets talk with your program script for voice recognition
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
| #!/usr/bin/env python | |
| # encoding=utf-8 | |
| # pip install pyaudio and pip install SpeechRecognition | |
| import speech_recognition as sr | |
| r = sr.Recognizer() | |
| with sr.Microphone() as source: | |
| print("Speak Anything :") | |
| audio = r.listen(source) | |
| try: | |
| text = r.recognize_google(audio) | |
| print("You said : {}".format(text)) | |
| except: | |
| print("Sorry could not recognize what you said") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment