AudioScheduledSourceNode - Web APIs 编辑

The AudioScheduledSourceNode interface—part of the Web Audio API—is a parent interface for several types of audio source node interfaces which share the ability to be started and stopped, optionally at specified times. Specifically, this interface defines the start() and stop() methods, as well as the onended event handler.

You can't create an AudioScheduledSourceNode object directly. Instead, use the interface which extends it, such as AudioBufferSourceNode, OscillatorNode, and ConstantSourceNode.

Unless stated otherwise, nodes based upon AudioScheduledSourceNode output silence when not playing (that is, before start() is called and after stop() is called). Silence is represented, as always, by a stream of samples with the value zero (0).

Properties

Inherits properties from its parent interface, AudioNode.

Methods

Inherits methods from its parent interface, AudioNode, and adds the following methods:

start()
Schedules the node to begin playing the constant sound at the specified time. If no time is specified, the node begins playing immediately.
stop()
Schedules the node to stop playing at the specified time. If no time is specified, the node stops playing at once.

Events

Listen to these events using addEventListener() or by assigning an event listener to the oneventname property of this interface:

ended
Fired when the source node has stopped playing, either because it's reached a predetermined stop time, the full duration of the audio has been performed, or because the entire buffer has been played.
Also available using the onended event handler property.

Specifications

SpecificationStatusComment
Web Audio API
The definition of 'AudioScheduledSourceNode' in that specification.
Working Draft 

Browser compatibility

BCD tables only load in the browser

See also

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

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

发布评论

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

词条统计

浏览:109 次

字数:4101

最后编辑:7 年前

编辑次数:0 次

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