Speech Recognition
Once AI Master triggers the AI Worker Process i.e. Aryan then execution is started and Human is greeted and asked "How can I help?" by Aryan. Thereafter SpeechRecognization flow is triggered to listen to Human and thereafter take next set of actions.
To start with a speech recognizer object is created as shown in snippet.
Default microphone is used to listen to Human inputs and captured using speech recognizer object in variable audio.
Google Speech Recognition Service over the web is used to convert the speech to text on the fly, output is stored in speech variable.
# Uses the default microphone as the source to listen voice
with sr.Microphone() as source:
# Listening to the Microphone source
audio = r.listen(source)
# Using Google Speech Recognization Service to recognize the Audio and Translate it to speech
speech = r.recognize_google(audio)
Last updated
Was this helpful?