This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

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