User:David.humphrey/Audio Data API 2: Difference between revisions

 
(4 intermediate revisions by the same user not shown)
Line 71: Line 71:
   channels          = event.mozChannels;
   channels          = event.mozChannels;
   rate              = event.mozRate;
   rate              = event.mozRate;
   frameBufferLength = event.frameBufferLength;
   frameBufferLength = event.mozFrameBufferLength;
}
}


Line 381: Line 381:
   readonly attribute unsigned long mozChannels;
   readonly attribute unsigned long mozChannels;
   readonly attribute unsigned long mozRate;
   readonly attribute unsigned long mozRate;
  readonly attribute unsigned long mozFrameBufferLength;
};
};
</pre>
</pre>


The '''mozChannels''' attribute contains a the number of channels in this audio resource (e.g., 2).  The '''mozRate''' attribute contains the number of samples per second that will be played, for example 44100.
The '''mozChannels''' attribute contains a the number of channels in this audio resource (e.g., 2).  The '''mozRate''' attribute contains the number of samples per second that will be played, for example 44100.  The '''mozFrameBufferLength''' attribute contains the number of samples that will be returned in each '''AudioWritten''' event.  This number is a total for all channels (e.g., 2 channels * 2048 samples = 4096 total).


===== nsIDOMNotifyAudioWrittenEvent =====
===== nsIDOMNotifyAudioWrittenEvent =====
Line 459: Line 460:
=== JavaScript Audio Libraries ===
=== JavaScript Audio Libraries ===


We have started work on a JavaScript library to make building audio web apps easier.  Details are [[Audio Data API JS Library|here]].
* We have started work on a JavaScript library to make building audio web apps easier.  Details are [[Audio Data API JS Library|here]].
* [http://github.com/bfirsh/dynamicaudio.js dynamicaudio.js] - An interface for writing audio with a Flash fall back for older browsers.


=== Working Audio Data Demos ===
=== Working Audio Data Demos ===
Line 471: Line 473:
* FFT visualization (calculated with js)
* FFT visualization (calculated with js)
** http://weare.buildingsky.net/processing/dsp.js/examples/fft.html
** http://weare.buildingsky.net/processing/dsp.js/examples/fft.html
* Beat Detection (also showing use of WebGL for 3D visualizations)
** http://cubicvr.org/CubicVR.js/bd3/BeatDetektor1HD-13a.html (video [http://vimeo.com/11345262 here])
** http://cubicvr.org/CubicVR.js/bd3/BeatDetektor2HD-13a.html (video of older version [http://vimeo.com/11345685 here])
** http://cubicvr.org/CubicVR.js/bd3/BeatDetektor3HD-13a.html (video [http://www.youtube.com/watch?v=OxoFcyKYwr0&fmt=22 here])


* Writing Audio from JavaScript, Digital Signal Processing
* Writing Audio from JavaScript, Digital Signal Processing
** Csound shaker instrument ported to JavaScript via Processing.js http://scotland.proximity.on.ca/dxr/tmp/audio/shaker/
** Csound shaker instrument ported to JavaScript via Processing.js http://scotland.proximity.on.ca/dxr/tmp/audio/shaker/


==== Demos Needing to be Updated to New API ====
==== Demos Needing to be Updated to New API ====
Line 486: Line 492:
** http://ondras.zarovi.cz/demos/audio/
** http://ondras.zarovi.cz/demos/audio/


* Beat Detection (also showing use of WebGL for 3D visualizations)
** http://cubicvr.org/CubicVR.js/BeatDetektor1HD.html (video [http://vimeo.com/11345262 here])
** http://cubicvr.org/CubicVR.js/BeatDetektor2HD.html (video [http://vimeo.com/11345685 here])
** http://weare.buildingsky.net/processing/beat_detektor/beat_detektor.html
** http://weare.buildingsky.net/processing/beat_detektor/beat_detektor.html
** http://code.bocoup.com/processing-js/3d-fft/viz.xhtml
** http://code.bocoup.com/processing-js/3d-fft/viz.xhtml
Confirmed users
656

edits