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.

AudioBuffer

Summary

This interface represents a memory-resident audio asset, primarily for one-shot sounds and other short audio clips. Its format is non-interleaved IEEE 32-bit linear PCM with a nominal range of -1 -> +1. It can contain one or more channels.

Properties

duration
Duration, in seconds, of the PCM audio data in the buffer.
length
Length, in sample-frames, of the PCM audio data.
numberOfChannels
The number of discrete audio channels described by the PCM audio data.
sampleRate
The sample rate, in samples per second, for the PCM audio data.

Methods

getChannelData
Returns the Float32Array representing the PCM audio data for the specific channel.

Events

No events.

Related specifications

W3C Web Audio API
W3C Editor’s Draft