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

#1 2011-12-11 22:08:37

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

JavaScript Sounds

Is there a way to play a sound after waiting "x" number of seconds?

If you want this in context:

There is a competition called "Academic Decathalon"; one of the sections is music, and part of the Music Test is identifying a piece based of a couple seconds, and then answering a question about it.  I'm trying to play a random song at a random point in the song.  I've already got the "play a random song" part working, but I don't know how (if it is even possible) to play a song/sound starting after a couple seconds.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#2 2011-12-12 12:26:17

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: JavaScript Sounds

Um, how about creating an audio element after a couple seconds?

Offline

 

#3 2011-12-12 12:55:59

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: JavaScript Sounds

u know audocity?

Offline

 

#4 2011-12-12 22:06:37

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: JavaScript Sounds

roijac wrote:

u know audocity?

Yes, but I don't want to have to save hundreds of audio files  hmm

scimonster wrote:

Um, how about creating an audio element after a couple seconds?

I think you misunderstood me.  I want to play the song on an event (I've got that worked out), but at a random point within the song.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#5 2011-12-12 23:26:12

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: JavaScript Sounds

SOLUTION ONE: use flash
SOLUTION TWO: use java
SOLUTION THREEEE: use scratch
SOLUTION FOUR: idk


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#6 2011-12-13 05:24:26

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: JavaScript Sounds

http://msdn.microsoft.com/en-us/library/gg589489%28v=vs.85%29.aspx


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#7 2011-12-13 07:05:57

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: JavaScript Sounds

Hardmath123 wrote:

http://msdn.microsoft.com/en-us/library/gg589489%28v=vs.85%29.aspx

Thank you!  currentTime seems to be what I want.  That was very helpful!


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#8 2011-12-13 18:26:34

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: JavaScript Sounds

Closed by request of the topic owner.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

Board footer