comparison webGL/src/sound.js @ 24:3f8305d62106 draft

final commit at Game group.
author e105711 <yomitan.ie.u-ryukyu.ac.jp>
date Thu, 19 Jul 2012 16:30:33 +0900
parents df7f7eef72ef
children
comparison
equal deleted inserted replaced
23:30c23f93cbc0 24:3f8305d62106
1 var filesLoaded = 1; // prevent early gameStart. 1 var filesLoaded = 1; // prevent early gameStart.
2 2 var EXT = "";
3 function loadSounds(){ 3 function loadSounds(){
4 4
5 var ext = "";
6 if((new Audio("")).canPlayType("audio/ogg") != "") 5 if((new Audio("")).canPlayType("audio/ogg") != "")
7 ext = ".ogg"; 6 EXT = ".ogg";
8 else if((new Audio("")).canPlayType("audio/wav") != "") 7 else if((new Audio("")).canPlayType("audio/wav") != "")
9 ext = ".wav"; 8 EXT = ".wav";
10 else 9 else
11 alert("your browser does not support wav and ogg File."); 10 alert("your browser does not support wav and ogg File.");
12 audioHClose = loadAudio("sound/hclose"+ext); 11 audioHClose = loadAudio("sound/hclose"+EXT);
13 audioSnare = loadAudio("sound/snare"+ext); 12 audioSnare = loadAudio("sound/snare"+EXT);
14 audioKick = loadAudio("sound/kick"+ext); 13 audioKick = loadAudio("sound/kick"+EXT);
15 audioTomA = loadAudio("sound/toma"+ext); 14 audioTomA = loadAudio("sound/toma"+EXT);
16 audioTomB = loadAudio("sound/tomb"+ext); 15 audioTomB = loadAudio("sound/tomb"+EXT);
17 audioFtom = loadAudio("sound/ftom"+ext); 16 audioFtom = loadAudio("sound/ftom"+EXT);
18 audioRide = loadAudio("sound/ride"+ext); 17 audioRide = loadAudio("sound/ride"+EXT);
19 audioCymbal = loadAudio("sound/cymbal"+ext); 18 audioCymbal = loadAudio("sound/cymbal"+EXT);
20 19
21 20
22 isAppLoaded(); // ensure gameStart. 21 isAppLoaded(); // ensure gameStart.
23 } 22 }
24 23