Audio Data API: Difference between revisions

Jump to navigation Jump to search
Line 436: Line 436:
The '''mozFrameBufferLength''' attribute indicates the number of samples that will be returned in the framebuffer of each '''MozAudioAvailable''' event.  This number is a total for all channels, and by default is set to be the number of channels * 1024 (e.g., 2 channels * 1024 samples = 2048 total).
The '''mozFrameBufferLength''' attribute indicates the number of samples that will be returned in the framebuffer of each '''MozAudioAvailable''' event.  This number is a total for all channels, and by default is set to be the number of channels * 1024 (e.g., 2 channels * 1024 samples = 2048 total).


The '''mozFrameBufferLength''' attribute can also be set to a new value, if users want lower latency, or larger amounts of data, etc.  The size given '''must''' be a power of 2 between 512 and 32768The following are all valid lengths:
The '''mozFrameBufferLength''' attribute can also be set to a new value, if users want lower latency, or larger amounts of data, etc.  The size given '''must''' be a number between 512 and 16384.  Using any other size will result in an exception being thrown.  The best time to set a new length is after the '''loadedmetadata''' event fires, when the audio info is known, but before the audio has started or '''MozAudioAvailable''' events begun firing.
 
* 512
* 1024
* 2048
* 4096
* 8192
* 16384
* 32768
 
Using any other size will result in an exception being thrown.  The best time to set a new length is after the '''loadedmetadata''' event fires, when the audio info is known, but before the audio has started or '''MozAudioAvailable''' events begun firing.


===== nsIDOMHTMLAudioElement additions =====
===== nsIDOMHTMLAudioElement additions =====
50

edits

Navigation menu