Use the Web Speech API’s SpeechRecognition interface to listen to the user’s voice.To build the web app, we’re going to take three major steps: Random_greeting = random.A simple AI chat bot demo with Web Speech API You should have something like this.įrom speech_recognition._main_ import r, audio Customize the code as you wish and create the final code.UserInput3 = input("or else search in google") Print(wikipedia.summary(r.recognize_google(audio)))Įngine.say(wikipedia.summary(r.recognize_google(audio))) Webbrowser.open('elif r.recognize_google(audio) in cmd3: Observation = owm.weather_at_place('Bangalore, IN') Webbrowser.open('elif r.recognize_google(audio) in cmd6: ("C:\\Users\Edward Zion SAJI\Downloads\Mighty_God_-_Martin_Colleen_")Įngine.say('I am edza your personal AI assistant') Print('It keeps changing every micro second')Įngine.say('It keeps changing every micro second') Random_greeting = random.choice(greetings)Įlif r.recognize_google(audio) in question: If r.recognize_google(audio) in greetings: We are going to use the above mentioned modules in a loop code to create the main functional code.
0 Comments
Leave a Reply. |