getChannelData
Summary
Returns the Float32Array representing the PCM audio data for the specific channel.
Method of apis/webaudio/AudioBufferapis/webaudio/AudioBuffer
Syntax
var = AudioBuffer.getChannelData(channel);
Parameters
channel
- Data-type
- unsigned long
The channel parameter is an index representing the particular channel to get data for. An index value of 0 represents the first channel. This index value MUST be less than numberOfChannels or an exception will be thrown.
Return Value
Returns an object of type
Float32Array
Examples
var myArrayBuffer = audioCtx.createBuffer(2, frameCount, audioCtx.sampleRate);
var nowBuffering = myArrayBuffer.getChannelData(channel);
Related specifications
- Web Audio API
- W3C Editor’s Draft