<pre>
// Create a new audio element
var audioOutput = new Audio();
// Set up audio element with 2 channel, 44.1KHz audio stream, volume set to full.
audioOutput.mozSetup(2, 44100, 1);
</pre>
<pre>
// Using Write samples using a JS Array
var samples = [0.242, 0.127, 0.0, -0.058, -0.242, ...];
audioOutput.mozWriteAudio(samples);
// Using Write samples using a Typed Array
var samples = new Float32Array([0.242, 0.127, 0.0, -0.058, -0.242, ...]);
audioOutput.mozWriteAudio(samples);
<pre>
// Get current position of the underlying audio stream, measured in samples written.
var currentSampleOffset = audioOutput.mozSampleOffset();
</pre>