annotate webGL/src/sound.js @ 0:9285dae61395 draft

1st commit,just play sounds.
author e105711 <yomitan.ie.u-ryukyu.ac.jp>
date Wed, 25 Apr 2012 23:45:59 +0900
parents
children 4fd71be3fb0b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 var audioHClose = window.Audio && new Audio("sound/hclose.wav");
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 var audioHClose2 = window.Audio && new Audio("sound/hclose.wav");
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 var audioHOpen = window.Audio && new Audio("sound/hopen.wav");
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 var audioHOpen2 = window.Audio && new Audio("sound/hopen.wav");
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 var audioFtom = window.Audio && new Audio("sound/ftom.wav");
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 var audioFtom2 = window.Audio && new Audio("sound/ftom.wav");
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 var audioCymbal = window.Audio && new Audio("sound/cymbal.wav");
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 var audioCymbal2 = window.Audio && new Audio("sound/cymbal.wav");
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 var audioKick = window.Audio && new Audio("sound/kick.wav");
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 var audioKick2 = window.Audio && new Audio("sound/kick.wav");
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 var audioSnare = window.Audio && new Audio("sound/snare.wav");
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 var audioSnare2 = window.Audio && new Audio("sound/snare.wav");
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 var audioBGM = window.Audio && new Audio("sound/BGM.wav");
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 var CymbalCnt = 0;
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 var HCloseCnt = 0;
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 var HOpenCnt = 0;
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 var FtomCnt = 0;
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 var KickCnt = 0;
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 var SnareCnt = 0;
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 function audioStop(audioFile){
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 if(!audioFile.ended){
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 audioFile.pause();
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 audioFile.load();
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 }
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 }
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 function audioStart(audioFile){
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 audioFile.load();
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 audioFile.play();
9285dae61395 1st commit,just play sounds.
e105711 <yomitan.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 }