AudioContextOptions.sampleRate - Web APIs 编辑
The AudioContextOptions
dictionary (used when instantiating an AudioContext
) may contain a property named sampleRate
, which indicates the sample rate to use for the new context. The value must be a floating-point value indicating the sample rate, in samples per second, for which to configure the new context; additionally, the value must be one which is supported by AudioBuffer.sampleRate
.
Syntax
audioContextOptions.sampleRate = 44100; var sampleRate = audioContextOptions.sampleRate;
Value
The desired sample rate for the AudioContext
, specified in samples per second. The value must be compatible with AudioBuffer.sampleRate
. This value should typically be between 8,000 Hz and 96,000 Hz; the default will vary depending on the output device, but the sample rate 44,100 Hz is the most common.
If the sampleRate
property is not included in the options, or the options are not specified when creating the audio context, the new context's output device's preferred sample rate is used by default.
Specifications
Specification | Status | Comment |
---|---|---|
Web Audio API The definition of 'AudioContextOptions.sampleRate' in that specification. | Working Draft | Initial definition. |
Browser compatibility
BCD tables only load in the browser
See also
AudioContext
: The interface describing an audio contextAudioContext()
: The audio context constructor, which accepts aAudioContextOptions
object as an input.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论