Table of Contents

speech recognition result

Description

The function reports the last text detected from the speech.

Speech Recognition

Example

Speech Recognition
The example demonstrates how to make smart home automation for light control using NLP and Speech Recognition.

Script

Output

Read More
Discover a unique experience in a Synonym/antonyms World, where the combined powers of Speech Recognition and ChatGPT Extension.

Introduction

Hey! Welcome to the fascinating realm of “Synonym/Antonym World,” where the powers of Speech Recognition and ChatGPT converge. Immerse yourself in an innovative platform that not only recognizes your speech but also provides an extensive collection of synonyms and antonyms for any given word. With this powerful combination, you can effortlessly expand your vocabulary, explore alternative expressions, and delve into the nuances of language. Unleash the potential of speech recognition and ChatGPT as you navigate through a world where words find their perfect counterparts. Get ready to unlock new dimensions of linguistic exploration in the captivating Synonym/Antonym World!

Code

Logic

  1. Open PictoBlox and create a new file.
  2. Choose a suitable coding environment for Block-based coding.
  3. We create an instance of the Speech recognition.This class allows us to convert spoken audio into text.
  4. Next, we create an instance of the ChatGPT model called gpt. ChatGPT is a language model that can generate human-like text responses based on the input it receives. 
  5. Recognize speech for 5 seconds using recognize speech for ()s in the () block.
  6. Save the recognized result in the “input” variable.
  7. Use the “get(synonyms) of ()” function to obtain synonyms of the recognized speech result.
  8. ChatGPT will provide the answers for 10 response synonyms in the “Synonym World” based on the given input.
  9. Use the “get(antonyms) of ()” function to obtain antonyms of the recognized speech result.
  10. The output of the anonymous word of the given input will be displayed by the sprite.
  11. Click on the green flag to run the code.

Output

Read More
Experience an interactive chatbox where you can specify the tone of AI responses. Ask questions or share thoughts on various topics, and receive personalized answers.

Introduction

In this interactive chatbox experience, the user has the freedom to specify the tone in which they would like the AI to respond. The tone can be anything they prefer: Normal, sarcastic, Friend that suits their preference.

Once the user has selected a particular tone, they can provide their input or ask a question. Based on their input, the AI will generate a response that aligns with the chosen tone. This allows for the creation of a conversational atmosphere similar to real-life interactions.

Users are encouraged to ask any question or share their thoughts on various topics. They can also engage in discussions or seek assistance with the information they need. The AI is there to facilitate a meaningful conversation and provide helpful responses based on the tone chosen by the user.

So, the user is requested to let the AI know the specific tone they would like it to adopt, and then they are free to ask any question they have in mind. The AI is here to provide a personalized and engaging chat experience!

Code

Logic

  1. Open PictoBlox and create a new file.
  2. Choose a suitable coding environment for Block-based coding.
  3. We create an instance of the Speech recognition.This class allows us to convert spoken audio into text.
  4. Next, we create an instance of the ChatGPT model called gpt. ChatGPT is a language model that can generate human-like text responses based on the input it receives. 
  5. We create an instance of the Text to Speech.This class allows us to speak the output.
  6. Use the “recognize speech” block to capture the user’s speech for a duration of 5 seconds.
  7. First, ask the user which format they prefer for the answer: normal, sarcastic, or friendly
  8. If the user requests a normal response, the ChatGPT extension will generate feedback in normal mode.
  9. If the user requests a sarcastic response, ChatGPT will generate a sarcastic answer.
  10. If the user requests a friendly response, ChatGPT will generate a friendly answer. Additionally, Sprite will speak the answer.
  11. The “speak” block, which utilizes the text-to-speech recognition extension, will vocalize the answer to the asked question.

In summary, we can describe it as a chatbox that provides answers in three different ways based on the user’s mood and entertainment preferences. When a question is asked, it will respond accordingly.

Output

Read More
Learn how to create your own voice-activated, intelligent virtual assistant using PictoBlox's AI and Speech Recognition extensions in this project. Control the entire conversation simply by pressing a key, and have your AI listen and speak back to you in real-time!

Introduction

Every time you talk to a virtual assistant, whether it is Google Assistant, Amazon Alexa, or Apple Siri a chain of AI processes springs into action in milliseconds. Your voice is captured and converted to text by a speech recognition model; that text is understood and processed by a language model, and a spoken response is delivered back to you. This entire pipeline is called a voice AI system.

In this project, we are going to build our very own simplified version of this pipeline inside PictoBlox — the Scratch-based AI and robotics programming platform by STEMpedia. Using just a few powerful block-coding extensions, students will experience firsthand how the same core AI technologies that Power the world’s most advanced voice assistants can be assembled, understood, and personalised in a visual programming environment. By the end of this project, you will have a working voice-activated AI chatbot that listens to you, thinks, and talks back — and you will understand exactly why it does so at each step of the AI pipeline.

Setting Up Your PictoBlox Voice AI Project

Step 1: Open PictoBlox and Log In

  1. Open PictoBlox. 
  2. Both the Speech Recognition extension and the ChatGPT extension require an active internet connection.

Step 2: Add the Required AI Extensions

Click the Add Extension button (the purple icon at the bottom left). Add the following three extensions:

  •   Speech Recognition — provides the ASR engine that listens to your microphone.
  •     ChatGPT — provides the Generative AI blocks for querying a language mode.

Step 3: Select Your Sprite

You can use any sprite for this project — Tobi is a great choice, as it provides a friendly visual face for your AI assistant. Click on your chosen sprite before adding the blocks below.

Step 4: 

  1. Slide up the power switch to turn on Quarky Intellio. A blue light will turn on – that means the Intellio is ON.

Turn on Quarky Intellio

  1. Click on Board at the top of your screen. Select Quarky Intellio!

Intellio Board Selection and Quarky Intellio Selection

  1. Click on Board at the top of your screen and select Quarky Intellio.
  2. Click the Connect tab in the top menu to connect with the serial port (USB). Be sure to Upload Firmware (top-right corner) for Intellio.

  1. Once the Upload Firmware is done, choose the Wi-Fi tab to connect Intellio with PictoBlox.
  2. Check out the Connection guide for Wi-Fi method – https://ai.thestempedia.com/docs/quarky-intellio/quarky-intellio-getting-started/quarky-intellio-connection-guide/#method2

Building the Voice AI Script: Step-by-Step Block Coding Guide

  1. From the Events palette, place a ‘when [space] key pressed’ hat block at the top of your script. This is the activation trigger for your AI assistant — pressing the spacebar starts the entire voice AI pipeline. 
  2. From the Speaker palette, add a ‘set language to [English]’ block. This configures the Automatic Speech Recognition (ASR) model to use its English acoustic model and language model, optimising it for recognising English phonemes, words, and sentence patterns.
  3. From the ChatGPT extension, add a ‘set maximum length to [15]’ block. This is a critical AI model parameter — it sets the maximum number of tokens (roughly equivalent to words or word-parts) the Generative AI model is allowed to produce in its response.
  4. From the Speech Recognition extension, add a ‘recognize speech for [5] s in [English (United States)]’ block. When this block executes, PictoBlox activates your computer’s microphone and streams the audio to the AI speech recognition service for 5 seconds. The AI model analyses the audio signal in real-time, applies noise reduction, identifies speech, and converts it into a text transcript.
  5. From the Looks palette, add a say [speech recognition result] block. This displays the text that the AI speech-recognition model heard and transcribed – giving the user visual confirmation of what the system understood. This is similar to the live captions feature in Google Meet or Microsoft Teams, where ASR output is shown in real time.
  6. From the ChatGPT extension, add an ‘ask [AI] [speech recognition result]’ block. This is the most powerful block in the entire script — it takes the transcribed speech text and sends it as a prompt to the connected Generative AI language model (powered by ChatGPT / OpenAI technology).
  7. From the Speaker palette, add a ‘speak [get AI response]’ block. This converts the AI’s text response back into spoken audio, completing the voice AI loop. Your AI assistant now speaks its answer out loud!
  8. From the Looks palette, add a ‘say [get AI response]’ block. This displays the AI’s response as a speech bubble on the screen — giving users both an audible and a visual output. Providing multi-modal output (voice + text) is a best practice in AI UX design, making the assistant accessible to users in different environments and with different needs.

Output

Conclusion

In this AI and STEM project, we built a complete voice AI assistant pipeline in PictoBlox – integrating Automatic Speech Recognition (ASR), a Generative AI Large Language Model (LLM), and Text-to-Speech (TTS) synthesis into a seamless voice-in, voice-out AI system using simple block coding.

We learnt how each AI technology in the pipeline works — from how deep learning ASR models transcribe speech, to how LLMs like ChatGPT generate intelligent text responses, to how neural TTS engines convert that text back into spoken language. We also explored important AI engineering concepts like token limits, language model configuration, event-driven activation, and multi-modal output design.

This project is an outstanding hands-on AI literacy activity for students in schools, Atal Tinkering Labs (ATLs), STEM coding labs, and home learning environments. The same technologies you have worked with today — ASR, LLMs, and TTS — are the building blocks of some of the most transformative AI applications in the world. Now you know exactly how they work and how to use them.

Read More
This project demonstrates how to create a voice-controlled smart plug using natural language processing (NLP), speech recognition, and a relay.

This project demonstrates how to create a voicecontrolled smart plug using natural language processing (NLP), speech recognition, and a relay.

Text Classifier in PictoBlox

We will use the PictoBlox Machine Learning environment for creating the text classifier.

Follow the steps to create the model:

  1. Open PictoBlox and the Machine Learning Environment.
  2. Click on Open Project and add import the following project file: Alexa
  3. Find the Alexa project in the list and open it to get the workspace of the text classifier.
  4. There will be 2 classes Lights On and Lights Off. Each class has some phases added corresponding to the action. You can add a few phases yourself.
  5. Click on Train Model to train the model.
  6. Once trained, you can check the model in the Testing tab. Add a phase and check if it provides the right sentiment.
    Note: If the model is not giving the desired results, then add more phases until the model is good.
  7. Click on the Export Model to create the blocks for the project.
  8. Test the block with some input text.

Circuit

The bulb is connected to the smart plug which is controlled with a relay.

Note:  A relay is an electromechanical switch that is used to turn on or turn off a circuit by using a small amount of power to operate an electromagnet to open or close a switch.

If the relay is ON, the smart switch gets ON, turning on the light. The relay has the following connections:

  1. GND Pin connected to GND of the Quarky Expansion Board.
  2. VCC Pin connected to VCC of the Quarky Expansion Board.
  3. Signal Pin connected to Servo 4 of the Quarky Expansion Board.

Code

The logic is the following – The Speech Recognition extension converts speech to text, which is then fed into the text classifier block. The text classifier block provides sentiment information, which is used to control the light via the relay.

Output

Read More
All articles loaded
No more articles to load