Speech Recognition
Extension Description
AI to recognize text from speech.
- Available in: Block Coding, Python Coding
- Mode: Stage Mode
- WiFi Required: Yes
- Compatible Hardware in Block Coding: evive, Quarky, Arduino Uno, Arduino Mega, Arduino Nano, ESP32, T-Watch, Boffin, micro:bit, TECbits, LEGO EV3, LEGO Boost, LEGO WeDo 2.0, Go DFA, None
- Compatible Hardware in Python: Quarky, None
- Object Declaration in Python: sr = SpeechRecognition()
- Extension Catergory: Artificial Intelligence
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:
- First, the machine records the audio file.
- 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.
- 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.
- Open PictoBlox and create a new file.
- Select the coding environment as Block Coding.
- Next, click on the Add Extension button and add the Speech Recognition extension.
- 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.
- Open PictoBlox and create a new file.
- Select the coding environment as Python Coding.
- Next, click on the Add Modules/Libraries button and add the Speech Recognition extension.
- To access the library functions, you have to add the object declaration.
sr = SpeechRecognition()
Read More
PictoBlox Blocks
All articles loaded
No more articles to load
Block Coding Examples
All articles loaded
No more articles to load
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
Python Coding Examples
All articles loaded
No more articles to load
Table of Contents