Speech Recognition

Extension Description
AI to recognize text from speech.

Introduction

Speech Recognition

Speech recognition is the ability of a machine to identify words and phrases in spoken language and convert them to a machine-readable format.

How Speech Recognition Works

Speech recognition is very complex, and many mathematical equations are involved. Let’s break it down into simple steps:

  1. First, the machine records the audio file.
  2. Then, it breaks down the audio to extract consonants and vowels (the building blocks of a text). After this process, we get a list of consonants and vowels.
  3. Using the word database of the language, the machine tries to identify words from the list and then make sentences, thus converting the speech into text.

Accessing Speech Recognition in Block Coding

Following is the process to add Speech Recognition capability to the PictoBlox Project.

  1. Open PictoBlox and create a new file.
  2. Select the coding environment as Block Coding.
  3. Next, click on the Add Extension button and add the Speech Recognition extension.
  4. You can find the Speech Recognition blocks available in the project.

Accessing Speech Recognition in Python Coding

Following is the process to add Speech Recognition capability to the PictoBlox Project.

  1. Open PictoBlox and create a new file.
  2. Select the coding environment as Python Coding.
  3. Next, click on the Add Modules/Libraries button and add the Speech Recognition extension.
  4. To access the library functions, you have to add the object declaration.
    sr = SpeechRecognition()

Python Functions

The function sets a loudness filter threshold to remove the background noise from the audio file which is being analyzed.
Syntax: setthreshold(loudness = 30)
When the function is executed, the recognition window will open and you will get a specified time during which PictoBlox will record whatever you say. Once recorded, the speech will be converted to the text of the language you spoke in and saved locally.
Syntax: analysespeech(time = 2, language = “en-US”)
The function reports the last text detected from the speech.
Syntax: speechresult()
All articles loaded
No more articles to load

PictoBlox Blocks

The block sets a loudness filter threshold to remove the background noise from the audio file which is being analyzed.
When the block is executed, the recognition window will open and you will get a specified time during which PictoBlox will record whatever you say. Once recorded, the speech will be converted to the text of the language you spoke in and saved locally.
The function reports the last text detected from the speech.
All articles loaded
No more articles to load

Block Coding Examples

Table of Contents