Adding Sounds
In this activity, you'll add sounds to your interactive project.
Just as with images, you have several options for adding sound to your project. You can use sounds built into Snap!, you can record your own sounds, you can import a sound file from your computer, or you can use Snap! to create music like you did in Lab 1: Song Player.
Revisiting Your Plan and Setting Up
Review your project plan. What kind of sounds make sense for your project? When should the sounds play?

- Drag a
block onto the stage in case you need to adjust the volume.
There are two kinds of sounds in Snap!: sound recordings (stored in the "Sounds" tab) and songs made by playing notes as the computer runs your program.
In Lab 1, you made songs by playing notes, and to hear them, you clicked a custom block made for this course, such as
or
.
To play sound recordings, you'll use either of these blocks from the "Sound" menu:
or
.
You'll notice the difference between these two new blocks if you snap two or more of them together. The play sound
block starts playing the sound while the computer keeps going through the blocks in your code. So, multiple sounds may play at the same time. The play sound until done
block doesn't let the computer move on to the next block in the script until the current song finishes playing.
Adding Sounds
-
Explore the instructions below and choose at least one method of adding sound to your project.
You add a Snap! built-in sound almost the same way you add a sprite costume or a stage background.
- Choose "Sounds..." from the File (
) menu.
- Play different sounds until you find one you want.
- Select the sound you want by clicking anywhere on its button except where the "Play" button is.
- Click "Import."
- Add more sounds if you want.
- Click "Cancel" to close the dialog box.
- To use a sound file that you have on your computer, drag the sound file anywhere into the Snap! window.
If you want to use an sound that someone else created, check to make sure that you are allowed to use it. If you are, leave a comment in your Snap
! code acknowledging the creator. You learned about adding comments in
Unit 1 Lab 6 Activity 1: Texting Time.
- Open the project with the song you want to import.
- Right-click the script that plays the song. (See note below about songs that use variables.)
- Click "export" to download that code.
- Open your interactive project.
- Import the file that downloaded.
This will not work for notes stored in a variable because variables aren't exported. So,
will work, but
will not work. If you have notes stored in a variable, move your list of notes directly into the play song
block before you export.
If your song is a script with multiple blocks, it will make your code neater to export/import if you create a new command block to store your song and you export that. Click for an example.
- Try out your sounds(s) and adjust them until they sound the way you want them to.
-
Add hat blocks to tell your sound(s) when to play. If you have more than one sound, use a hat block to tell the computer when to play each one. For example:

In this activity, you learned different ways of adding sounds to a Snap! project and chose one or more ways of adding sound to your interactive project.