This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-05-10 19:29:49

RagnARok
Scratcher
Registered: 2008-09-07
Posts: 20

Pause and play songs

I found out that you can't pause a song or sound once it is being played, it only allows you to restart or play the song/sound form the start. Maybe there should be a pause/play block. That could be helpful.

Last edited by RagnARok (2009-05-10 19:30:01)

Offline

 

#2 2009-05-10 20:30:15

BWOG
Scratcher
Registered: 2008-09-19
Posts: 1000+

Re: Pause and play songs

Yeah. And a 'Play sound [_\/] from (_) secs' block

Last edited by BWOG (2009-05-10 20:30:54)

Offline

 

#3 2012-02-10 09:03:54

ayvadia
New Scratcher
Registered: 2012-02-10
Posts: 4

Re: Pause and play songs

set volume to 100%
set "length so far" to 0
play sound "sound"
broadcast "start timer"
set sound playing to 1

Offline

 

#4 2012-02-10 09:07:03

ayvadia
New Scratcher
Registered: 2012-02-10
Posts: 4

Re: Pause and play songs

[setblocks]
When I receive "start timer"
forever if "sound playing"=1 and "length so far"<"length of song"
wait .1 second
change length so far by .1
[\setblocks]

[setblocks]
When P clicked
stop all sounds
set "sound playing" to 0
[\setblocks]

[setblocks]
When S clicked
set volume to 0%
play sound "sound"
wait "length so far" seconds
set volume to 100%
set "song playing" to 1
[\setblocks]

Offline

 

Board footer