Created
December 8, 2020 12:57
-
-
Save Abhayparashar31/37f13ccf0685e6845d817891f5996ecb 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 | |
r = sr.Recognizer() | |
with sr.Microphone() as source: | |
t_end = time.time() + 5 | |
while time.time() < t_end: | |
print("karl: Listening...") | |
audio=r.listen(source) | |
try: | |
query = r.recognize_google(audio) | |
print(f"user:{query}") | |
except" | |
print("Try Again") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment