Skip to content

Instantly share code, notes, and snippets.

@SULAIMAN-5-AHMED
Last active November 2, 2022 14:37
Show Gist options
  • Save SULAIMAN-5-AHMED/6668ae4cae23cf9f87111ea5cf69e13e to your computer and use it in GitHub Desktop.
Save SULAIMAN-5-AHMED/6668ae4cae23cf9f87111ea5cf69e13e to your computer and use it in GitHub Desktop.
import speech_recognition as sr
import webbrowser
recog = sr.Recognizer()
with sr.Microphone() as source:
print('WHAT DO YOU WANT TO SEARCH: ')
audio = recog.listen(source)
try:
text = recog.recognize_google(audio)
print(f'YOUR SAID: {text}')
except:
print("SORRY ALOT OF NOISE!")
webbrowser.open_new('https://www.google.com/search?q=' + text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment