Discuss Scratch

Somebuggy
Scratcher
15 posts

Stopping sounds on other sprites

I am trying to create a project where when you click on the song title it plays the song. If halfway through a song the person clicks on a different one, I'd like the new song to start and the old one to stop. But i'm having trouble figuring out how to do that because the sounds are all in different sprites, so far it's just a lot of chaos with overlapping songs. The best idea I can think of is when the sprite gets clicked to send a message specific for that sprite and if it receives a message not specific towards that sprite it will stop all sounds.
g6g6g66g6g
Scratcher
100+ posts

Stopping sounds on other sprites

When a sprite changes the song you can set a variable to the new song name and send a “new song” broadcast. When the music playing sprite receives the broadcast, it can stop all sounds, then directly play the set song with

play sound (song)
Somebuggy
Scratcher
15 posts

Stopping sounds on other sprites

Thanks for the help. I was able to figure out stopping and starting audio without overlap.
However everything involved with audio on Scratch is really buggy, and I know it's not just me because i've had issues with audio on multiple different devices and different WiFi's.
For example if an audio is too large the project either wont save or the audio wont play or it won't let me edit it, so I split it into multiple parts.
Now whenever I click on the sprite that triggers the audio it's jumping ahead several seconds and not playing the beggining of the sound, though I know that's not a problem with the actual audio clip, I even tried reuploading it.

Does anyone else have bugs with scratch audio and is there anyway to fix this?

Powered by DjangoBB