AudioBuffer
constructor of the
Web 音频 API
creates a new
AudioBuffer
对象。
var audioBuffer = new AudioBuffer(options);
Inherits parameters from the
AudioNodeOptions
dictionary
.
选项
length
: The size of the audio buffer in sample-frames. To determine the
length
to use for a specific number of seconds of audio, use
numSeconds * sampleRate
.
numberOfChannels
: The number of channels for the buffer. The default is 1, and all user agents are required to support at least 32 channels.
sampleRate
: The sample rate in Hz for the buffer. The default is the sample rate of the
context
used in constructing this object. User agents are required to support sample rates from 8,000 Hz to 96,000 Hz (but are allowed to go farther outside this range).
context
AudioContext
. This parameter was removed from the spec.
新的
AudioBuffer
对象实例。
NotSupportedError
numberOfChannels
being higher than supported, or a
sampleRate
outside the nominal range).
RangeError
There isn't enough memory available to allocate the buffer.
| 规范 | 状态 | 注释 |
|---|---|---|
|
Web 音频 API
The definition of 'AudioBuffer' in that specification. |
工作草案 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
AudioBuffer()
构造函数
|
Chrome
55
注意事项
|
Edge ≤79 | Firefox 53 | IE 不支持 No |
Opera
42
注意事项
|
Safari ? |
WebView Android
55
注意事项
|
Chrome Android
55
注意事项
|
Firefox Android 53 |
Opera Android
42
注意事项
|
Safari iOS ? |
Samsung Internet Android
6.0
注意事项
|
完整支持
不支持
兼容性未知
见实现注意事项。
AudioBuffer
AudioBuffer()
AnalyserNode
AudioBufferSourceNode
AudioContext
AudioContextOptions
AudioDestinationNode
AudioListener
AudioNode
AudioNodeOptions
AudioParam
AudioProcessingEvent
AudioScheduledSourceNode
AudioWorklet
AudioWorkletGlobalScope
AudioWorkletNode
AudioWorkletProcessor
BaseAudioContext
BiquadFilterNode
ChannelMergerNode
ChannelSplitterNode
ConstantSourceNode
ConvolverNode
DelayNode
DynamicsCompressorNode
GainNode
IIRFilterNode
MediaElementAudioSourceNode
MediaStreamAudioDestinationNode
MediaStreamAudioSourceNode
OfflineAudioCompletionEvent
OfflineAudioContext
OscillatorNode
PannerNode
PeriodicWave
StereoPannerNode
WaveShaperNode