# Music - How to stop the sound

**URL:** https://forum.code.org/t/music-how-to-stop-the-sound/6683
**Category:** Unit and Lesson Discussion
**Tags:** csp-unit-5, csp-unit-5-lesson-3
**Created:** [February 7, 2017, 6:55pm UTC](https://forum.code.org/t/music-how-to-stop-the-sound/6683 "2017-02-07T18:55:49Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![carmichaelc](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/carmichaelc/32/921_2.png) [@carmichaelc](https://forum.code.org/u/carmichaelc)
#### Post date: [February 7, 2017, 6:55pm UTC](https://forum.code.org/t/music-how-to-stop-the-sound/6683/1 "2017-02-07T18:55:49Z")

</div>

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

---

<div class="post-metadata">

### Author: ![baker](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/baker/32/1229_2.png) [@baker](https://forum.code.org/u/baker)
#### Post date: [February 8, 2017, 4:00pm UTC](https://forum.code.org/t/music-how-to-stop-the-sound/6683/2 "2017-02-08T16:00:54Z")

</div>

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.

![](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex016/uploads/codeorgforum/original/2X/5/5d2b28e0a16ab77b4f191642969eaa6728df7876.jpg)

---

<div class="post-metadata">

### Author: ![carmichaelc](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/carmichaelc/32/921_2.png) [@carmichaelc](https://forum.code.org/u/carmichaelc)
#### Post date: [February 9, 2017, 9:30pm UTC](https://forum.code.org/t/music-how-to-stop-the-sound/6683/3 "2017-02-09T21:30:29Z")

</div>

Thanks Baker! I passed this on to my students.

---

<div class="post-metadata">

### Author: ![jmpauley](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@jmpauley](https://forum.code.org/u/jmpauley)
#### Post date: [March 2, 2017, 8:33pm UTC](https://forum.code.org/t/music-how-to-stop-the-sound/6683/4 "2017-03-02T20:33:42Z")

</div>

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

---

<div class="post-metadata">

### Author: ![juliechew](https://avatars.discourse-cdn.com/v4/letter/j/9de0a6/32.png) [@juliechew](https://forum.code.org/u/juliechew)
#### Post date: [February 22, 2019, 9:11pm UTC](https://forum.code.org/t/music-how-to-stop-the-sound/6683/5 "2019-02-22T21:11:38Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![carmichaelc](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/carmichaelc/32/921_2.png) [@carmichaelc](https://forum.code.org/u/carmichaelc)
#### Post date: [February 23, 2019, 12:34pm UTC](https://forum.code.org/t/music-how-to-stop-the-sound/6683/6 "2019-02-23T12:34:32Z")

</div>

Thank you! Three files below

[https://docs.google.com/document/d/1wuC7wypejOSs9A8VfyECNNWuAJbSbzN4EHSrHi-sxxc/edit](https://docs.google.com/document/d/1wuC7wypejOSs9A8VfyECNNWuAJbSbzN4EHSrHi-sxxc/edit)

[https://docs.google.com/document/d/1KGF-HxAP65bvQbzugKORXnzfplptWvw2eqCMntm8qS0/edit](https://docs.google.com/document/d/1KGF-HxAP65bvQbzugKORXnzfplptWvw2eqCMntm8qS0/edit)

[https://docs.google.com/document/d/1i3g-wTNQ0MlCeL57SdNZ-e6QhdiKk9txfrAKTAQ4pDc/edit](https://docs.google.com/document/d/1i3g-wTNQ0MlCeL57SdNZ-e6QhdiKk9txfrAKTAQ4pDc/edit)

---

<div class="post-metadata">

### Author: ![hannah](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/hannah/32/4837_2.png) [@hannah](https://forum.code.org/u/hannah)
#### Post date: [February 26, 2019, 6:57pm UTC](https://forum.code.org/t/music-how-to-stop-the-sound/6683/7 "2019-02-26T18:57:36Z")

</div>

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

---

<div class="post-metadata">

### Author: ![juliechew](https://avatars.discourse-cdn.com/v4/letter/j/9de0a6/32.png) [@juliechew](https://forum.code.org/u/juliechew)
#### Post date: [February 27, 2019, 10:45pm UTC](https://forum.code.org/t/music-how-to-stop-the-sound/6683/8 "2019-02-27T22:45:10Z")

</div>

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

---

<div class="post-metadata">

### Author: ![victoria\_mariano](https://avatars.discourse-cdn.com/v4/letter/v/278dde/32.png) [@victoria\_mariano](https://forum.code.org/u/victoria_mariano)
#### Post date: [February 3, 2020, 7:04pm UTC](https://forum.code.org/t/music-how-to-stop-the-sound/6683/9 "2020-02-03T19:04:37Z")

</div>

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”);  
});

---

<div class="post-metadata">

### Author: ![gjschmidt](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/gjschmidt/32/4922_2.png) [@gjschmidt](https://forum.code.org/u/gjschmidt)
#### Post date: [February 3, 2020, 10:47pm UTC](https://forum.code.org/t/music-how-to-stop-the-sound/6683/10 "2020-02-03T22:47:39Z")

</div>

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

---

<div class="post-metadata">

### Author: ![wilsoeri1](https://avatars.discourse-cdn.com/v4/letter/w/a587f6/32.png) [@wilsoeri1](https://forum.code.org/u/wilsoeri1)
#### Post date: [February 11, 2020, 2:44pm UTC](https://forum.code.org/t/music-how-to-stop-the-sound/6683/11 "2020-02-11T14:44:45Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![madeline\_r\_burton](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/madeline_r_burton/32/5037_2.png) [@madeline\_r\_burton](https://forum.code.org/u/madeline_r_burton)
#### Post date: [February 12, 2020, 6:39pm UTC](https://forum.code.org/t/music-how-to-stop-the-sound/6683/12 "2020-02-12T18:39:37Z")

</div>

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

---

<div class="post-metadata">

### Author: ![wilsoeri1](https://avatars.discourse-cdn.com/v4/letter/w/a587f6/32.png) [@wilsoeri1](https://forum.code.org/u/wilsoeri1)
#### Post date: [February 13, 2020, 2:42pm UTC](https://forum.code.org/t/music-how-to-stop-the-sound/6683/13 "2020-02-13T14:42:27Z")

</div>

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.

> [@Sound in games distorts](https://forum.code.org/t/sound-in-games-distorts/23941/8):
>
> Can you tell me what the ‘false’ is in the playSound? Thank you!

---

<div class="post-metadata">

### Author: ![madeline\_r\_burton](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/madeline_r_burton/32/5037_2.png) [@madeline\_r\_burton](https://forum.code.org/u/madeline_r_burton)
#### Post date: [February 13, 2020, 3:26pm UTC](https://forum.code.org/t/music-how-to-stop-the-sound/6683/14 "2020-02-13T15:26:59Z")

</div>

Great! Thanks for the update.
