Discuss Scratch

mrcreatorluigi
Scratcher
1000+ posts

How to pause audio without it delaying?

I’m trying to play music with an option to pause it. Here is the script I use when I pause it:
set [pitch v] to ([log v] of ())::sound

But when I pause the music it delays itself if you pause it for too long, longer the pause the more the delay. Here is the project link, the script is in the Video sprite, under the “pause” message hat block.
https://turbowarp.org/557255956

wait this is my 500th post? But it’s only my 268th…

Last edited by mrcreatorluigi (Aug. 1, 2021 02:55:18)


if i was in aladdin, my first wish would be to have infinite wishes, and use those infinite wishes for infinite wishes on each wish, rince and repeat
PraCoco
Scratcher
1000+ posts

How to pause audio without it delaying?

mrcreatorluigi wrote:

I’m trying to play music with an option to pause it. Here is the script I use when I pause it:
set [pitch v] to ([log v] of ())::sound

But when I pause the music it delays itself if you pause it for too long, longer the pause the more the delay. Here is the project link, the script is in the Video sprite, under the “pause” message hat block.
https://turbowarp.org/557255956

wait this is my 500th post? But it’s only my 268th…
I don't really think there is a way…
I just stretch a pause in the audio for how long I want it to be.

‎‎‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎‎‎‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‏‏‎
‎‎‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‎‎‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‎vi/ray/ana | she/her | 15 | artist/coder | sagittarius | chocoholic | potterhead | gryffindor | nerd
‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎
mrcreatorluigi
Scratcher
1000+ posts

How to pause audio without it delaying?

PraCoco wrote:

mrcreatorluigi wrote:

I’m trying to play music with an option to pause it. Here is the script I use when I pause it:
set [pitch v] to ([log v] of ())::sound

But when I pause the music it delays itself if you pause it for too long, longer the pause the more the delay. Here is the project link, the script is in the Video sprite, under the “pause” message hat block.
https://turbowarp.org/557255956

wait this is my 500th post? But it’s only my 268th…
I don't really think there is a way…
I just stretch a pause in the audio for how long I want it to be.
I’ve seen projects do that before though, no delays

if i was in aladdin, my first wish would be to have infinite wishes, and use those infinite wishes for infinite wishes on each wish, rince and repeat
ShLe95
Scratcher
12 posts

How to pause audio without it delaying?

I'm not really seeing any of a delay. What do you mean by that?
mrcreatorluigi
Scratcher
1000+ posts

How to pause audio without it delaying?

ShLe95 wrote:

I'm not really seeing any of a delay. What do you mean by that?
I’m setting the tempo to -Infinity which is a REALLY low pitch meaning very slow, but not enough to make the music stop completely

if i was in aladdin, my first wish would be to have infinite wishes, and use those infinite wishes for infinite wishes on each wish, rince and repeat
mafrtpoll
Scratcher
80 posts

How to pause audio without it delaying?

when green flag clicked
set volume to (0) %
Set [pitch v] effect to (( -1 ) / (0))

the minimum the pitch effect can go is a value -360, meaning that it is impossible to fully pause sounds using the pitch effect blocks. That is the reason the set volume to 0 block is needed, otherwise the sound would still be heard. While it may be impossible to fully pause sounds this way, this method will still get very close.

Powered by DjangoBB