# Problem with audio

**URL:** <https://forum.code.org/t/problem-with-audio/32652>\
**Category:** Coding and Debugging Help\
**Created:** [May 10, 2020, 4:10pm UTC](https://forum.code.org/t/problem-with-audio/32652 "2020-05-10T16:10:07Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![mwood](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/mwood/32/4941_2.png) [@mwood](https://forum.code.org/u/mwood)\
**Post date:** [May 13, 2020, 3:10pm UTC](https://forum.code.org/t/problem-with-audio/32652/4 "2020-05-13T15:10:30Z")

</div>

So, the difference between the crybaby sound and the others appears to be how it is triggered. The crybaby sound is triggered when two conditions are true. (The spacebar is pressed and slide==1) There even appears to be a 3rd condition (QW==1), but I’m not sure what that is for or if it’s needed.

The other sounds are played (and replayed and replayed and replayed) every time the draw loop sees that the program is on the given slide (slide 7, the credits). So while the user is stopped on slide 7, the draw loop keeps running, sees that you are on slide 7 and starts the sound again.

Two possible solutions… one would be to trigger the sound for slide 7 and for the credits the same way it was triggered for the crybaby slide. Another way may be to adapt a suggestion made on some previous posts you can read about here:

> [@Sound Playing when hitting a target](https://forum.code.org/t/sound-playing-when-hitting-a-target/32623/2):
>
> Hi @nmackow, Although I am not sure of your specific example, there could be a few reasons. The simplest answer from the [documentation](https://studio.code.org/docs/gamelab/playSound/) is to make sure the loop parameter is set to false. Another reason the sound continues to play is because whatever was true to trigger the sound, loops 32 times per second so it is likely the sound will start to play again and again. So, to problem solve this, the best way is to make sure what triggers the sound to play quickly becomes false so the sound doesn…

Good luck! This project continues to evolve and get better!

Mike

---

_[View the full topic](https://forum.code.org/t/problem-with-audio/32652)._
