Open ghost opened 2 years ago
yes you are true this could be done with this code
import speech_recognition as sr recognizer = sr.Recognizer() microphone = sr.Microphone() with microphone as source: print("Speak now...") recognizer.adjust_for_ambient_noise(source) audio = recognizer.listen(source) response = recognizer.recognize_google(audio).lower()
plz let me know if this code works for you and other viewers
@Empireofprogrammers , I am thankful that you commented on this issue. The code you have written however would not do anything related to the web browser. The code you have written is actually for recognizing the input given by the user. What I meant was that to simply :
import webbrowser
and simply use this module to open any web url by :
webbrowser.open('www.yourlink.com')
I hope you'd test this yourself and see the results.
Sorry, I was answering my repository question mistakenly I put the code in the incorrect repository Very Sorry By the Way You are right
I personally feel that the code written to open the web browser in speech.py is too long. There is actually no need to specify the path of the chrome installation. Just the use the web browser module and it would open it in the default browser. If you want to open it with chrome, set chrome as default browser. Hope you'd fix this.