Discuss Scratch

TechShock
Scratcher
3 posts

I can't loop music properly. I ALREADY FIXED THIS.

When I connect a forever block to a music block and play it it makes a weird looping noise instead of looping the music i want. Pls respond ASAP

Last edited by TechShock (Sept. 16, 2025 00:52:35)

NMario84
Scratcher
1000+ posts

I can't loop music properly. I ALREADY FIXED THIS.

Do NOT use
play sound [ v]

Instead use this
play sound [ v] until done

So for example:
when green flag clicked
forever
play sound [song v] until done
end
Scratchuser2790
Scratcher
14 posts

I can't loop music properly. I ALREADY FIXED THIS.

NMario84 wrote:

Do NOT use
play sound [ v]

Instead use this
play sound [ v] until done

So for example:
when green flag clicked
forever
play sound [song v] until done
end


yea hes right
OlivePen
Scratcher
100+ posts

I can't loop music properly. I ALREADY FIXED THIS.

TechShock wrote:

When I connect a forever block to a music block and play it it makes a weird looping noise instead of looping the music i want. Pls respond ASAP
You either have this block playing on loop:
play sound [ v]

Or you have this block on loop even if you have the “play sound until done” block instead of “play sound”:
stop all sounds
tidelgl
Scratcher
100+ posts

I can't loop music properly. I ALREADY FIXED THIS.

I hope I am not late, most of the time I like the broadcast events.

when green flag clicked
set [Music Playing? v] to [true]
broadcast [start music v] and wait

when I receive [start music v]
forever
if <(Music Playing?) = [true]> then
play sound [Music v] until done
else
stop all sounds
break // This exits the forever loop cleanly
end
end

when [space v] key pressed // Your stop/start trigger
if <(Music Playing?) = [true]> then
set [Music Playing? v] to [false]
else
set [Music Playing? v] to [true]
broadcast [start music v] and wait
end
iplayamongus4life
Scratcher
100+ posts

I can't loop music properly. I ALREADY FIXED THIS.

using
play sound [ v]
on a
forever

end
breaks the sound, because the start sound block STARTS the sound, and doesn't wait for it to end. use
play sound [ v] until done
on forever blocks or blocks that repeat.
forever
play sound [ v] until done
end
iplayamongus4life
Scratcher
100+ posts

I can't loop music properly. I ALREADY FIXED THIS.

tidelgl wrote:

I hope I am not late, most of the time I like the broadcast events.

when green flag clicked
set [Music Playing? v] to [true]
broadcast [start music v] and wait

when I receive [start music v]
forever
if <(Music Playing?) = [true]> then
play sound [Music v] until done
else
stop all sounds
break // This exits the forever loop cleanly
end
end

when [space v] key pressed // Your stop/start trigger
if <(Music Playing?) = [true]> then
set [Music Playing? v] to [false]
else
set [Music Playing? v] to [true]
broadcast [start music v] and wait
end
I think they are asking about why the start sound block isn't working on forever blocks, and not a start/stop trigger, but I could be wrong and extra code could be helpful.

Last edited by iplayamongus4life (Sept. 12, 2025 16:31:47)

TechShock
Scratcher
3 posts

I can't loop music properly. I ALREADY FIXED THIS.

Okay ill try some of the scripts!
tysm for the tips!

Last edited by TechShock (Sept. 13, 2025 22:11:16)

The_Cool_Test_Alt
Scratcher
100+ posts

I can't loop music properly. I ALREADY FIXED THIS.

Why does everyone keep saying

play sound [ v]

instead of

start sound [ v]
GoodboyzoomScratch
Scratcher
34 posts

I can't loop music properly. I ALREADY FIXED THIS.

TechShock wrote:

When I connect a forever block to a music block and play it it makes a weird looping noise instead of looping the music i want. Pls respond ASAP
If you are using this script:
when green flag clicked
forever
start sound [ v]
end
Then it will try to play the sound a bunch of times without waiting the sound to finish.
thats because the “Play Sound” Block plays a sound immediately without waiting it to finish.

Meanwhile the “Play sound until done” will play the sound but it will wait until the sound is finished to proceed to next script.

So the correct way to make a sound loop is by using this script:
when green flag clicked
forever
play sound [ v] until done
end

Last edited by GoodboyzoomScratch (Sept. 14, 2025 22:20:26)

TechShock
Scratcher
3 posts

I can't loop music properly. I ALREADY FIXED THIS.

@goodboyzoomscratch i already fixed the bug, but thanks!

Powered by DjangoBB