AudioBuffer()

This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the specification changes.

The AudioBuffer constructor creates a new AudioBuffer object.

Syntax

var audioBuffer = new AudioBuffer([options]);
var audioBuffer = new AudioBuffer(context[, options]);

Parameters

context 
A reference to an AudioContext. This parameter was removed from the spec. See the Browser Compatibility section for details.
options Optional
Options are as follows:
  • length: The length in sample frames of the buffer.
  • numberOfChannels: The number of channels for the buffer. The default is 1. 
  • sampleRate: The sample rate in Hz for the buffer. The default is the sample rate of the context used in constructing this object.

Specifications

Specification Status Comment
Web Audio API
The definition of 'AudioBuffer' in that specification.
Working Draft Initial definition.

Browser Compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 55
58 (no context parameter)
? ? 42
45 (no context parameter)
?
Feature Android Webview Chrome for Android Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile
Basic support 55
58 (no context parameter)
55
58 (no context parameter)
? ? ? 42
45  (no context parameter)
?

Document Tags and Contributors

 Contributors to this page: jpmedley, bunnybooboo
 Last updated by: jpmedley,