This component is used to show a specific portion of an AudioBuffer (MDN). The waveform is draw with SVG (instead of Canvas) to keep the vectorial advantage.
.setResolution( w<Number>, h<Number> )
This method will call
svg.setAttribute( "viewBox", "0 0 " + w + " " + h );.
setResolutionwill not fire another
.draw( left<Float32Array>, right<Float32Array>, bufferDuration<Number>, offset<Number>, duration<Number> )
rightare the audioData of the two different channels (left and right) extracted from an AudioBuffer with
bufferDurationis the total duration (in second) of the AudioBuffer.
durationdelimite a specific portion of the buffer to draw (like the
None of these 5 arguments are optional.
.render( buffer<AudioBuffer>, offset<Number>, duration<Number> )
This is a shortcut to the complex
.drawprevious method. Here, the method will extracts itself the data from the AudioBuffer, and will can read the
bufferDuration. The method will take
The two last arguments are optional.
Clear and remove the whole
Clear the SVG by removing the
pointsattribute of the