# 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.

{% hint style="info" %}
[SpeechRecognition ](https://pypi.org/project/SpeechRecognition/)Library is used for performing speech recognition, with support for several engines and APIs, online and offline.

Speech recognition engine/API support:

* CMU Sphinx (works offline)&#x20;
* Google Speech Recognition&#x20;
* Google Cloud Speech API&#x20;
* Wit.ai&#x20;
* Microsoft Bing Voice Recognition&#x20;
* Houndify API&#x20;
* IBM Speech to Text&#x20;
* Snowboy Hotword Detection (works offline)

Currently Aryan used Google Speech Recognition for Speech Recognition
{% endhint %}

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.

```python
# 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)
```

{% hint style="info" %}
Thereafter **SpeechAction** flow is triggered to perform the actions on basis of the Speech, It has following &#x20;

* Text Procession and Transformation
* Keyword Identification
* Action using Learned Skills
* Speech to Text Conversion
* Next Step
  {% endhint %}
