In this add-on,
you will add a sound that plays
each time a character speaks.
To start, select the Isabel Talk or the 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.
(tuba playing)
(Texas harp playing)
(robot beeping)
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.
(tuba playing)
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 drop-down menu.
Add a stop all sounds block.
Test it out.
(tuba playing)
Cool.
Next, if you'd like, add sound to the other sprite.
Add the play sound block under the stop all sounds block,
that way the other sound will stop playing
before this sprite's sound starts playing.
This example uses the robot sound.
Next, click the other Talks sprite
and add the stop all sounds block
above the play sound block.
Click the flag to test.
(tuba playing)
(robot beeping)
Great.
Each sprite plays a sound
when it receives the message to talk.
And that sounds stops playing
when the other sprite begins to talk.
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.