Mercurial > hg > Members > e105711
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/webGL/src/sound.js Wed Apr 25 23:45:59 2012 +0900 @@ -0,0 +1,32 @@ +var audioHClose = window.Audio && new Audio("sound/hclose.wav"); +var audioHClose2 = window.Audio && new Audio("sound/hclose.wav"); +var audioHOpen = window.Audio && new Audio("sound/hopen.wav"); +var audioHOpen2 = window.Audio && new Audio("sound/hopen.wav"); +var audioFtom = window.Audio && new Audio("sound/ftom.wav"); +var audioFtom2 = window.Audio && new Audio("sound/ftom.wav"); +var audioCymbal = window.Audio && new Audio("sound/cymbal.wav"); +var audioCymbal2 = window.Audio && new Audio("sound/cymbal.wav"); +var audioKick = window.Audio && new Audio("sound/kick.wav"); +var audioKick2 = window.Audio && new Audio("sound/kick.wav"); +var audioSnare = window.Audio && new Audio("sound/snare.wav"); +var audioSnare2 = window.Audio && new Audio("sound/snare.wav"); +var audioBGM = window.Audio && new Audio("sound/BGM.wav"); + +var CymbalCnt = 0; +var HCloseCnt = 0; +var HOpenCnt = 0; +var FtomCnt = 0; +var KickCnt = 0; +var SnareCnt = 0; + +function audioStop(audioFile){ + if(!audioFile.ended){ + audioFile.pause(); + audioFile.load(); + } +} + +function audioStart(audioFile){ + audioFile.load(); + audioFile.play(); +} \ No newline at end of file