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

#1 2012-01-27 21:38:16

MathMaster101
Scratcher
Registered: 2011-10-29
Posts: 100+

how come when i make a sound play forever it goes to fast

when i do this

when gf clicked
forever
 play sound [WaterRunning v]
end
the sound seems glitchy and sounds like this (kinda): "ththththththththththth"

I am trying to loop this sound.
can someone please tell me how i can loop sounds on scratch as background music plz!!!

Last edited by MathMaster101 (2012-01-27 21:39:06)


https://sphotos.xx.fbcdn.net/hphotos-snc6/c39.0.403.403/p403x403/196165_191956434263692_1014187386_n.jpg

Offline

 

#2 2012-01-27 21:43:02

demosthenes
Retired Community Moderator
Registered: 2008-02-19
Posts: 1000+

Re: how come when i make a sound play forever it goes to fast

The problem is that you are using the play sound block. Each time through the loop it will start the sound at the beginning. What you wait is the "play sound until done" block.


I've taken a long hiatus, but I still visit sometimes. Give me some time to answer any messages you post on my projects!

Offline

 

#3 2012-01-27 21:44:14

MathMaster101
Scratcher
Registered: 2011-10-29
Posts: 100+

Re: how come when i make a sound play forever it goes to fast

demosthenes wrote:

The problem is that you are using the play sound block. Each time through the loop it will start the sound at the beginning. What you wait is the "play sound until done" block.

oh


https://sphotos.xx.fbcdn.net/hphotos-snc6/c39.0.403.403/p403x403/196165_191956434263692_1014187386_n.jpg

Offline

 

#4 2012-01-27 21:45:22

slayerrobe7
Scratcher
Registered: 2011-06-24
Posts: 500+

Re: how come when i make a sound play forever it goes to fast

try

when gf clicked
forever
play sound [WaterRunning v] until done
end


!!!When it comes to Scratch2.0 I am totally like freaking out!!!

Offline

 

#5 2012-01-28 05:09:23

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: how come when i make a sound play forever it goes to fast

You need to put:

when gf clicked
forever
play sound [WaterRunning v] until done
end
wink


Why

Offline

 

#6 2012-01-28 05:19:34

JSO
Community Moderator
Registered: 2007-06-23
Posts: 1000+

Re: how come when i make a sound play forever it goes to fast

The 'play sound' block actually starts a sound, but the script continues. So your script will keep restarting the sound before you can even hear it properly.

So the above suggestions work,or if you want a smoothly looping sound you could do something like this:

when green flag clicked
forever
  play sound [WaterRunning v]
  wait (8.15) secs //adjust until you can't notice the pause anymore
end


http://oi48.tinypic.com/2v1q0e9.jpg

Offline

 

#7 2012-01-28 10:32:39

treebark1313
Scratcher
Registered: 2011-05-23
Posts: 90

Re: how come when i make a sound play forever it goes to fast

You need "Play sound until done" Not just "Play sound" That should work.  smile


When life gives you 100 reasons to frown,
show life you have 1000 reasons to smile. - Unknown

Offline

 

#8 2012-01-28 16:15:22

a1130
Scratcher
Registered: 2009-08-27
Posts: 500+

Re: how come when i make a sound play forever it goes to fast

The answer has been said many times, but I guess I will repeat it  smile

Well, using the 'play sound' block just starts the sound while simultaneously continuing the rest of the script.

So what is happening now is that it is simultaneously running the forever loop and playing the sound which results in that "tththththth" noise- a snippet of the beginning of that sound.

The solution would be to use

play sound [WaterRunning v] until done
instead of just
play sound [WaterRunning v]
because "play sound until done" is exactly what you need- it plays the sound until it finishes and THEN continues the script.

OR:
Let's say that the sound is 5 seconds long. You could do what JSO said and do some thing like this:

when gf clicked
forever
play sound [WaterRunning v]
wait (5) secs
end
This allows the script to wait the length it takes to play the sound before starting over. However this method is rather time consuming and I guess "play sound until done" would be easier to do.

Last edited by a1130 (2012-01-28 16:17:11)

Offline

 

#9 2012-01-30 17:46:44

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: how come when i make a sound play forever it goes to fast

You could do

when green flag clicked
forever if <(water running)=(1)>
  play sound [water running v] until done
end
then when you set the variable water running to 0 the sound will stop.


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#10 2012-04-09 17:36:12

mythbusteranimator
Scratcher
Registered: 2012-02-28
Posts: 1000+

Re: how come when i make a sound play forever it goes to fast

By using,

when gf clicked
forever
 play sound [WaterRunning]
 
It will keeps restarting the sound. However, with
forever
 play sound [WaterRunning] until done
 
It will wait until the sound file has finished and THEN restart it.

So basically,
play sound [WaterRunning] until done
 
waits until the file is finished playing to move on in the script.


http://www.foxtrot.com/comics/2012-04-01-fdb37077.gif
clicky

Offline

 

#11 2012-04-14 01:42:06

baileyburrito
Scratcher
Registered: 2010-03-08
Posts: 19

Re: how come when i make a sound play forever it goes to fast

I had this problem once. Try this:
when gf clicked
forever
play sound Whatever till done


https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQojjwZw6nX1wb6BzXeJ4wNpVS3TtFpKw89fQScSlD13Vici4TB

Offline

 

#12 2012-04-14 01:45:58

TorbyFork234_Test
Scratcher
Registered: 2012-04-04
Posts: 15

Re: how come when i make a sound play forever it goes to fast

mythbusteranimator wrote:

By using,

when gf clicked
forever
 play sound [WaterRunning]
 
It will keeps restarting the sound. However, with
forever
 play sound [WaterRunning] until done
 
It will wait until the sound file has finished and THEN restart it.

So basically,
play sound [WaterRunning] until done
 
waits until the file is finished playing to move on in the script.

necropost

Offline

 

Board footer