Changes

Jump to: navigation, search

Audio Data API

No change in size, 02:46, 17 August 2010
no edit summary
</pre>
The '''LoadedMetadataloadedmetadata''' event is a standard part of HTML5. It now indicates that a media element (audio or video) has useful metadata loaded, which can be accessed using three new attributes:
* mozChannels
* mozFrameBufferLength
Prior to the '''LoadedMetadataloadedmetadata''' event, accessing these attributes will cause an exception to be thrown, indicating that they are not known, or there is no audio. These attributes indicate the '''number of channels''', audio '''sample rate per second''', and the '''default size of the framebuffer''' that will be used in '''MozAudioAvailable''' events. This event is fired once as the media resource is first loaded, and is useful for interpreting or writing the audio data.
The '''MozAudioAvailable''' event provides two pieces of data. The first is a framebuffer (i.e., an array) containing decoded audio sample data (i.e., floats). The second is the time for these samples measured from the start in seconds. Web developers consume this event by registering an event listener in script like so:
Confirm
656
edits

Navigation menu