In this add-on, you will add a sound that plays each time a character speaks.
This example uses a tuba sound, which sounds like the teacher from the classic Peanuts' animations.
To start, select the Isabel talk or Malik talk sprite.
Program the sprite to play a sound each time the character talks.
Add a "when I receive" block, and select either the Isabel talking or the Malik talking message.
Click the sounds tab to see the sounds available in the starter project.
Click the play button to hear each sound.
If you'd like, add another sound from the Scratch library.
Add the sound to the project using the "play sound" block.
Click the block stack to test.
The sound keeps playing even after Malik starts talking To fix this, select the other sprite.
Add a "when I receive" block, and select the correct talking message from the dropdown menu.
Add a "stop all sounds block."
Test it out.
Next, if you'd like, add a sound to the other sprite.
This example uses the robot sound. Add the "play sound" block under the "stop all sounds" block.
That way, the other sound will stop playing before the sprite’s sound starts playing.
Next, click the other talk sprite, and add the "stop all sounds" block above the "play sound" block.
Click the flag to test.
Each sprite plays a sound when it receives the message to talk, and that sound stops playing when the other sprite begins to speak.
Now, it's your turn.
Program a sprite to play a sound when it receives its talking message.
Program the other sprite to stop all sounds when it receives its talking message.
If you'd like, add a sound to the other sprite, and program the first sprite to stop all sounds before it starts playing its sound.