草案
此页面不完整。
AudioContextLatencyCategory
type is an enumerated set of strings which are used to select one of a number of default values for acceptable maximum latency of an audio context.
By using these strings rather than a numeric value when specifying a latency to a
AudioContext
, you can allow the
用户代理
to select an appropriate latency for your use case that makes sense on the device on which your content is being used.
AudioContextLatencyCategory
can be used when constructing a new
AudioContext
by passing one of these values as the
latencyHint
option in the
AudioContext()
constructor's options dictionary.
| 值 | 描述 |
|---|---|
"balanced"
|
The user agent should balance audio output latency and power consumption when selecting a latency value. |
"interactive"
|
The audio is involved in interactive elements, such as responding to user actions or needing to coincide with visual cues such as a video or game action. The user agent should select the lowest possible latency that doesn't cause glitches in the audio. This is likely to require increased power consumption. This is the default value. |
"playback"
|
The user agent should select a latency that will maximize playback time by minimizing power consumption at the expense of latency. Useful for non-interactive playback, such as playing music. |
| 规范 | 状态 | 注释 |
|---|---|---|
|
Web 音频 API
The definition of 'AudioContextLatencyCategory' in that specification. |
工作草案 | 初始定义。 |
Showing compatibility for
latencyHint
.
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
latencyHint
|
Chrome 60 | Edge ≤79 | Firefox 61 | IE No | Opera ? | Safari ? | WebView Android 60 | Chrome Android 60 | Firefox Android 61 | Opera Android ? | Safari iOS ? | Samsung Internet Android 8.0 |
完整支持
不支持
兼容性未知
AudioContextLatencyCategory
AnalyserNode
AudioBuffer
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