simple sounds?

7 views
Skip to first unread message

Evgeny

unread,
Apr 26, 2013, 12:06:38 AM4/26/13
to webgl-d...@googlegroups.com
http://www.ibiblio.org/e-notes/Splines/water/little_game_moz.html

Two simple sounds are added for Mozilla

 function playSound() {
   var output = new Audio();
   output.mozSetup(1, 44100);
   var sound1 = new Float32Array(22050);

   for (var i = 0; i < samples.length ; i++)
      sound1[i] = Math.sin( (i + .001*i*i) / 20 )*Math.exp(-i*.0007);
//      sound2[i] = Math.pow( Math.sin( i*i*i ), 100)*Math.exp(-i*.0002);

   output.mozWriteAudio(sound);
 }
I've found very quickly this simple script for Mozilla, but I didn't find analog for WebKit after googling Web for about 2 hours. And it takes me ages to learn Web Audio API (till Monday I think :).
Don't you have a ready script for simple sounds for WebKit (Web Audio API)?


Evgeny
Reply all
Reply to author
Forward
0 new messages