AudioBuffer()

我们的志愿者还没有将这篇文章翻译为 中文 (简体)加入我们帮助完成翻译!
您也可以阅读此文章的English (US)版。

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)
?

文档标签和贡献者