Music - How to stop the sound

How do you stop the sound if a students puts in a long song to play on a screen? @baker

Thereā€™s a new command called stopSound(). It appears in the toolbox in freeplay app lab, but might not in some of the levels, since we have to go through each an add by hand. But you can see (from the screenshot) itā€™s pretty self explanatory.

1 Like

Thanks Baker! I passed this on to my students.

This post just saved my class from the sound not stopping! Thanks Baker! Marianne

Is there any extra documentation for stopsound()? When we try to access it (ā€œSee examplesā€) for stopsound(), we get a ā€œthe requested page was not foundā€ error.

Thank you! Three files below

https://docs.google.com/document/d/1wuC7wypejOSs9A8VfyECNNWuAJbSbzN4EHSrHi-sxxc/edit

https://docs.google.com/document/d/1KGF-HxAP65bvQbzugKORXnzfplptWvw2eqCMntm8qS0/edit

https://docs.google.com/document/d/1i3g-wTNQ0MlCeL57SdNZ-e6QhdiKk9txfrAKTAQ4pDc/edit

@juliechew Iā€™ll take a look at what happened to the documentation and relink it. Thanks for letting us know!

Thanks Hannah! The command is pretty intuitive, but documentation will be helpful.

stopSound is not stopping the music. \onEvent(ā€œwalkingplayā€, ā€œclickā€, function(){
playSound(ā€œJojiā€”Jackson-Wangā€”Walking-ft.-Swae-Leeā€”Major-Lazer-(Lyric-Video).mp3ā€, false);
});
onEvent(ā€œwalkingstopā€, ā€œclickā€, function(){
stopSound(ā€œJojiā€”Jackson-Wangā€”Walking-ft.-Swae-Leeā€”Major-Lazer-(Lyric-Video).mp3ā€);
});

Can you include the share link from the program? It makes it easier to take a look at it that way.

My students are having the same problem. Did anyone ever find a solution to the sound not stopping with the command? It even continues after we reset the program. We can only get it to stop by refreshing the page.

1 Like

@wilsoeri1 Would you be willing to share a project that uses this feature? It would be helpful to see it in context!

I actually found an answer on a different thread after searching for a while yesterday. If you hit the extension arrow on the play sound, there is a drop down that says true or false. If you make it false it does not loop the sounds. Then adding a stop sound after that makes sure that it stops all sound. Thank you for trying to help!

The solution is seen in the image below.

Great! Thanks for the update.