Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Pause music?
- supercoder4
-
35 posts
Pause music?
I'm working on a game that needs to pause the music, or it will just sound bad. I've been trying to do this for a while, but no luck yet. Is there anything I'm missing? Thanks!
- Hero_man_555
-
72 posts
Pause music?
I'm assuming you want the music to pick right off where it left of, but just incase you want something simpler, you'll just need to make a variable that when the game is paused, it stops all sounds and vice versa. If you want the music to keep playing from the same section, I'd have no idea how to do that, but there's probably some way to log what time/beat the song stopped on.
- supercoder4
-
35 posts
Pause music?
Yea I want it to stop, then start at the same spot. I've seen someone who just pauses it by stopping it then turning the volume down to zero, playing it until you stopped, then put thevolume back up. Also, nice profile pic
- deck26
-
1000+ posts
Pause music?
If you're just using the play sound blocks you can't pause the music - the blocks always play the sound from the start.
Last edited by deck26 (Oct. 27, 2021 16:40:18)
- Hero_man_555
-
72 posts
Pause music?
Yea I want it to stop, then start at the same spot. I've seen someone who just pauses it by stopping it then turning the volume down to zero, playing it until you stopped, then put thevolume back up. Also, nice profile pic
Thanks for the compliment
I think one possible solution would be the break up the song into a bunch of small parts and have those play one after another. It won't be exact but it won't start from the beginning. Not sure if this will impact project size greatly though.
- Hero_man_555
-
72 posts
Pause music?
You could just change the Volume to -100 when you pause
Yeah, but that'll mean that the music will keep going while the game is still paused, and the OP doesn't want the music to skip ahead while the game is paused. (I think)
- MarioFan792
-
14 posts
Pause music?
You could just do this:
Hope this helped
You would have to do the music in a separate spite because then all the sounds in the sprite would pause.
Hope this helped

- EpicGhoul993
-
1000+ posts
Pause music?
Not really effective if you pause for too long. You could just do this:You would have to do the music in a separate spite because then all the sounds in the sprite would pause.
Hope this helped
Tbh I think #6 has a good solution, though I don't know how to trim perfectly in Scratch.
- supercoder4
-
35 posts
Pause music?
Im new in talking to people on here, so what does OP mean? The creator of the thread?You could just change the Volume to -100 when you pause
Yeah, but that'll mean that the music will keep going while the game is still paused, and the OP doesn't want the music to skip ahead while the game is paused. (I think)
- supercoder4
-
35 posts
Pause music?
Yea it does kinda work, but for not for a long time You could just do this:You would have to do the music in a separate spite because then all the sounds in the sprite would pause.
Hope this helped
- Discussion Forums
- » Help with Scripts
-
» Pause music?