Discuss Scratch

Gamdapiko24
Scratcher
57 posts

Pause and play button not working

https://scratch-mit-edu.ezproxyberklee.flo.org/projects/1134263578/editor/

I am making an OS in scratch and am currently working on the music app. I added a pause and play button to play American Boy. It dosen't work.

Please help.
-Your_Nightmare-
Scratcher
10 posts

Pause and play button not working

Can you tell me what you're trying to pause? If you're trying to pause the music try using this

Pause:
set [pitch v] effect to (-100)

Play:
set [pitch v] effect to (100)
Gamdapiko24
Scratcher
57 posts

Pause and play button not working

I'm trying to pause the music that is playing in the “Music App” sprite. When the play button is pressed (after clicking the music app), it should play the song then pause when I press the button.
HighlaneGamingStudio
Scratcher
100+ posts

Pause and play button not working

-Your_Nightmare- wrote:

Can you tell me what you're trying to pause? If you're trying to pause the music try using this

Pause:
set [pitch v] effect to (-100)

Play:
set [pitch v] effect to (100)
That wouldn't work because the music would keep playing in the background, even if slowly. What would work better would be this:
when I receive [pause music v]
set [pitch v] effect to (-10000000000)
set volume to (0) %
when I receive [play music v]
set [pitch v] effect to (0)
set volume to (100) %
Low pitch makes the sound slow down, and setting the pitch to a really low number creates the illusion of pausing and playing the audio. I added the volume block so that the computer wouldn't be able to detect the really low pitched slow sound to ensure the illusion stayed.
NotK3ndricAltAgain
Scratcher
100+ posts

Pause and play button not working

Here:
when I receive [pause v]
set [pitch v] effect to ((-1) / (0))
set volume to (0)%

when I receive [play v]
set [pitch v] effect to (0)
set volume to (100)%
Gamdapiko24
Scratcher
57 posts

Pause and play button not working

HighlaneGamingStudio wrote:

-Your_Nightmare- wrote:

Can you tell me what you're trying to pause? If you're trying to pause the music try using this

Pause:
set [pitch v] effect to (-100)

Play:
set [pitch v] effect to (100)
That wouldn't work because the music would keep playing in the background, even if slowly. What would work better would be this:
when I receive [pause music v]
set [pitch v] effect to (-10000000000)
set volume to (0) %
when I receive [play music v]
set [pitch v] effect to (0)
set volume to (100) %
Low pitch makes the sound slow down, and setting the pitch to a really low number creates the illusion of pausing and playing the audio. I added the volume block so that the computer wouldn't be able to detect the really low pitched slow sound to ensure the illusion stayed.
Thank you so much!
I haven't even though about using broadcasts.
This worked. Thanks.

Powered by DjangoBB