Sound effects ahoy

Spencer can talk and make funny noises as well. It comes preloaded with a bunch of sound effects and dialogues. 

You can generate your own voice dialogues too, but first, let's play some of the preloaded sound samples.

The section called "Playback" has everything sound-related in it. Let's start by dragging and dropping the "Play audio sample" block onto te drawing area.

random image

Place the block into the Arduino run first branch so that the sound effect gets played as soon as your program starts.

random image

Next, we need to choose the sound effect that is going to be played. 

There is a whole section of different samples you can choose and explore from.

I'll take the sample block named "Special".

random image

You need to place this sample block into the "Play audio sample" block. You can choose the different audio samples present in the "Special" category of audio samples by pressing on the drop-down menu.

random image

If you Run this code and upload it to your Spencer, it will play the selected sound effect as soon as your program starts.

If we want to add a bit more oomph to our code, we can make Spencer play a different audio sample every time you press its button. Your code should look like this if you want to do so: 

random image

Remember to save your code! 
This was fun. Let's see what else we can do.