forked from codehouseindia/Python-Programs
-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathspeechrecognition.py
More file actions
26 lines (26 loc) · 804 Bytes
/
speechrecognition.py
File metadata and controls
26 lines (26 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#https://www.facebook.com/100028679802914/posts/449717249327598/
#subcribed by Nikita Desale
import speech_recognition as sr
import webbrowser as wb
import pyaudio as audio
r1=sr.Recognizer()
r2=sr.Recognizer()
r3=sr.Recognizer()
with sr.Microphone() as source:
print('search google')
print('speack now')
audio=r3.listen(source)
if 'search' in r2.recognize_google(audio):
r2=sr.Recognizer()
url='https://google.com/search?q='
with sr.Microphone() as source:
print('search ur query')
audio=r2.listen(source)
try:
get=r2.recognize_google(audio)
print(get)
wb.get().open_new(url+get)
except sr.UnknownValueError:
print('Error')
except sr.RequestError as e:
print('Failed'.format(e))