Changes

Jump to: navigation, search

User:David.humphrey/Audio Data API 2

607 bytes added, 16:28, 21 May 2010
Writing Audio
</script>
</pre>
 
Audio data written using the '''mozWriteAudio()''' method needs to be written at a regular interval in equal portions, in order to keep a little ahead of the current sample offset (current sample offset of hardware can be obtained with '''mozCurrentSampleOffset()'''), where a little means something on the order of 500ms of samples. For example, if working with 2 channels at 44100 samples per second, and a writing interval chosen that is equal to 100ms, and a pre-buffer equal to 500ms, one would write an array of (2 * 44100 / 10) = 8820 samples, and a total of (currentSampleOffset + 2 * 44100 / 2).
===== Complete Example: Creating a Web Based Tone Generator =====
Confirm
656
edits

Navigation menu