AudioContextLatencyCategory - Web APIs 编辑

Draft

This page is not complete.

The 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 user agent 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.

Values

ValueDescription
"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.

Specifications

SpecificationStatusComment
Web Audio API
The definition of 'AudioContextLatencyCategory' in that specification.
Working DraftInitial definition.

Browser compatibility

BCD tables only load in the browser

Showing compatibility for latencyHint.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:47 次

字数:2933

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文