play sound --- for --- seconds

id: 10707

category: Suggestions

posts: 21

ronford ronford loading
I really miss a ‘play sound — for — seconds’
or even better:
'play sound — from — to — seconds' (two time locations in the audio)
Now you're stuck playing the whole audio from only the beginning.
And because there is only a ‘stop all sounds’ possibility, and not a ‘stop this sound’, it makes stopping and starting of audio in different layers very limited.
Maybe a little complicated for younger programmers, but the possibilities of playing with audio inside a program is very limited (as opposed to the visual possibilities in Scratch) and this would possibly widen the scope on the audio side a little.


I agree. Scratch should allow more flexible sound manipulation.
cheeseeater cheeseeater loading
Agree, I would would like a ‘play sound for ___ seconds’ block.
I agree! I would like a block like this too: Play sound ___till___.
goldfish678 goldfish678 loading
There's a simple workaround:

play sound (pulldown menu)
wait (wanted time of sound playing) secs

goldfish678 wrote:

There's a simple workaround:

play sound (pulldown menu)
wait (wanted time of sound playing) secs
O rly? Try starting a sound other than at 0:00.
mitchboy mitchboy loading

ProdigyZeta7 wrote:

goldfish678 wrote:

There's a simple workaround:

play sound (pulldown menu)
wait (wanted time of sound playing) secs
O rly? Try starting a sound other than at 0:00.
You could have it play with the volume at 0 for a while, then change the volume to 100. It doesn't work if you need it right away, though.
footsocktoe footsocktoe loading
One simple solution is to get Audacity (free download) and use it to cut your sound into separate sounds, each of which begins where you need it to.
PERCE-NEIGE PERCE-NEIGE loading
Why in audacity? You can cut and paste in Scratch sound editor.
The problem with stopping sound is real, I agree with the author of this post. When you have several sound playing in the same time, and you need to stop only ONE sound, you can't!
Imagine the extended possibility of programming if you could!
DotDash DotDash loading
maybe ST could add a dropdown on the stop all sounds block so you could choose a specific sound, but it still has all in the dropdown.
the second idea is good, because you can't make a cut-up of every sound variant you want, and if the times it begins/stops at are affected by something like variables it would be a pain to go

if variable=1
'play sound (1)'
if variable=2
'play sound (2)'
etc

it would be easier to just be like

'play sound (1) from (variable) to (end)
I really think this should be useful because in there could be a wait when a block is runned.

play sound [sound v] for () secs :: sound
Carriage Carriage loading
Waiiit this is a duplicate lemme find the link…
also, simple workaround:
play sound [meow v]
wait (1) secs
broadcast [next script v]
stop [this script v]

Carriage wrote:

Waiiit this is a duplicate lemme find the link…
also, simple workaround:
play sound [meow v]
wait (1) secs
broadcast [next script v]
stop [this script v]
There's a stop all sounds block, you know?

However, what if another sound is playing at the ame time?
DaEpikDude DaEpikDude loading
I think that the "play sound from (time) to (time) is a better idea: maybe the first dropdown could have “start” in it along with being able to type in any number, and the second could have “end”?
Frication Frication loading
move (110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) steps
Support, Scratch needs to get more serious and improvise with sound blocks — there's very low possibilites atm.

This is already possible using the set volume to () block if you give 0 in the input though, but that's a bit complicated.
Maybe instead of this block these?
start sound [sound v] at […] seconds::sound
stop sound [sound v]::sound
(current [time v] of sound [sound v]::sound)//with the options time, volume, and pitch

Charles12310 wrote:

(#13)
I really think this should be useful because in there could be a wait when a block is runned.

play sound [sound v] for () secs :: sound

DotDash wrote:

(#11)
maybe ST could add a dropdown on the stop all sounds block so you could choose a specific sound, but it still has all in the dropdown.
There is a
 start sound [sound v] at () seconds :: sound 
block and a
 play sound [sound v] starting at () seconds until done :: sound 
block in Snail IDE, along with a
 stop sound [sound v] :: sound 
block.
Can't you duplicate the sound and crop it at the correct length?
Although this could be useful for huge projects with a lot of music so semi support