How to Make Your Version Of Siri On Scratch

How to Make Your Version Of Siri On Scratch: Most Fun Scratch Project!

By Ghousia Parveen Taj

Siri as most of us are aware is the voice assistant on Apple devices just like Amazon’s Alexa, Microsoft’s Cortana, Google’s google assistant. 

Having a voice assistant on your device is both useful and convenient. So, today, we are going to make a project on Scratch that is based on Siri on Apple devices. 

Well, simply put we are going to make our version of Siri on Scratch.

Siri Functions

There are various specific functions that Siri can perform such as

  • Make calls/Initiate Facetime 
  • Send/read texts 
  • Set alarm/times 
  • Set reminders/check calendar 
  • Split a check or calculate a tip 
  • Play music 
  • Identify songs, provide song info like artists and release date, etc 
  • Control home kit products 
  • Play TV shows and movies, answer questions about them 

Besides these functions, Siri can also perform many other functions that can help users in different ways. 

To explore more about how Siri can do simple calculations like “Addition”, “Subtraction” and other mathematical operations, I am going to use Scratch. So, Let’s get started.

For this project, I am going to use the online application of Scratch 3.0. We can also download the offline application of Scratch 3.0 and use it. Here, is the link to Scratch.

Before we start with the project, let me explain the Scratch platform for a better understanding of the project. 

About Scratch Programming

Scratch was designed by MIT for school-going students so that they can connect with a programming language as they grow and develop interests in programming, the programming language used in scratch is called “Block-based programming”.

So, let’s get started with our code for our version of Siri on Scratch or what we call also call a “Virtual Calculator”. 

How to Make Your Version Of Siri on Scratch – Virtual Calculator

Design

Step 1: Click on the create button to create a new project. 

How to Make Your Version Of Siri On Scratch

Step 2: Download an image of “mic” and save it to some location on your computer then upload the image as a sprite in Scratch. 

To upload the image click on the cat icon at the very right bottom corner and then click on the upload sprite button and then upload the image from your device. 

How to Make Your Version Of Siri On Scratch

Step 3: Now start designing for this Sprite, Select the image and resize, rename and reposition the sprite from the right bottom corner.

How to Make Your Version Of Siri On Scratch

Step 4: To add the “Text to Speech Extension” to convert the text to speech for the sprite “mic”. 

To select this go to the left bottom corner like this.

How to Make Your Version Of Siri On Scratch

The window shown in the image will be opened for you if you click on the extension icon.

How to Make Your Version Of Siri On Scratch

Click on the “Text to Speech” button to select this extension. When you add this extension, it will show up at the bottom of the block panel, as shown in the image.

How to Make Your Version Of Siri On Scratch

Code

Step 1: After adding the “Text to Speech” extension, Let’s create the variable, “number” which is required for mathematical operations in the project. 

To do this go to the code panel and click on the “variable” button and then click on the “make a variable” button to make the variable.

How to Make Your Version Of Siri On Scratch

When you click on the “Make a Variable” button, a new window will appear as shown in the image; in this window, type the name of the variable as “number” and click on the “OK” button.

How to Make Your Version Of Siri On Scratch

Step 2: On the Coding Panel, click on the “Event” button and select the block shown below,

How to Make Your Version Of Siri On Scratch

and drag it to the middle panel or workspace.

How to Make Your Version Of Siri On Scratch

Now you can start coding.

The complete coding for “Virtual Calculator” or Siri in Scratch is shown below.

Part 1:

How to Make Your Version Of Siri On Scratch

Part 2:

How to Make Your Version Of Siri On Scratch

Part 3:

How to Make Your Version Of Siri On Scratch

Part 4:

How to Make Your Version Of Siri On Scratch

Part 5:

How to Make Your Version Of Siri On Scratch

Part 6:

How to Make Your Version Of Siri On Scratch

Explanation of Codes

How to Make Your Version Of Siri On Scratch

It is an Event Block, in this project it is being used to start the “Virtual Calculator”, Events blocks tell Scratch when to start running the program by setting a triggering moment, such as clicking the green flag. 

How to Make Your Version Of Siri On Scratch

This block is used to set the variable “number” as 0 as when the “Virtual Calculator ” gets started the number variable should be 0.

How to Make Your Version Of Siri On Scratch

This block is from “Text to Speech” to set the voice of the speaker. For this project, I have used “alto” as this is the voice of a female. 

How to Make Your Version Of Siri On Scratch

This block is used to convert the text to speech. Here,

How to Make Your Version Of Siri On Scratch

The join code is from the “Operator” block and is used to connect two different Strings.

How to Make Your Version Of Siri On Scratch

This code is from “Sensing” and is used to determine the user name; by using this block, we can make the “Virtual Calculator” speak about the various users.

How to Make Your Version Of Siri On Scratch

This block is used to convert the text to speech.

How to Make Your Version Of Siri On Scratch

 This Event Block is used to trigger the sprite, every time the sprite is clicked, the codes attached to this block will get triggered. 

How to Make Your Version Of Siri On Scratch

This code block is from Sensing Block and this block is used to receive input from the user.

How to Make Your Version Of Siri On Scratch

If a block is a logical block, it is used here to apply logic, because this “Virtual Calculator” can perform four operations, namely addition, subtraction, multiplication, and division, so for each operation, the user must type a specific number in the text input block, 1 for “Addition”, 2 for “Subtraction”, 3 for “Multiplication”, and 4 for “Division”.

After the project is complete rename the project from here: 

How to Make Your Version Of Siri On Scratch

Conclusion

Click on the Share button to share the project. You can also copy the URL and share the project with your family and friends. 

I hope you enjoyed and learned something from this blog; feel free to make changes and remix the project as you see fit. 

The link to the complete project is attached here: 

Happy Learning!

Learn Scratch at BrightChamps with its specially designed curriculum that makes learning programming easy for students in Grade 1-12.

BrightChamps also teaches a variety of other programs that help kids build a foundation in computer programming through activities, interactive lessons, and other means.

Explore the BrightCHAMP blog page to discover educational insights, tips, and strategies like coding games for kids and kids coding languages to enhance your child’s learning experience.

Ghousia Parveen Taj

⭐⭐⭐⭐⭐

I am a coding enthusiast who enjoys coding in various programming languages such as Python and JavaScript. I am also a coding instructor and enjoy doing scratch projects for my students. At BrightChamps, I hope to instil in my students the same enthusiasm for coding that I have. Learn from Me

Reach Us

Categories

General Sidebar Widget Coding

Get a Talent Discovery Certificate after trial class

100% Risk-Free. No Credit Card Required

Explore Our Courses

Related Articles

Trending Articles