AudioScheduledSourceNode - Web API 接口参考 编辑
AudioScheduledSourceNode
接口作为web音频API的一部分,是几种具有在特定时刻开始与停止能力的音频源节点接口的父接口。更具体地来说,这个接口定义了start()
和stop()
方法,以及onended
事件
你不能直接创建AudioScheduledSourceNode
。而是应该使用继承于它的子接口,如AudioBufferSourceNode
, OscillatorNode
和ConstantSourceNode
.
除非另有说明,基于AudioScheduledSourceNode
节点的输出在没有播放时处于静默状态(这种状态在start()之前与stop()之后调用)。静默状态总是由一个全0值流组成。
Properties
Inherits properties from its parent interface, AudioNode
, and adds the following properties:
Event handlers
onended
- A function to be called when the
ended
event is fired, indicating that the node has finished playing.
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.
Specification
Specification | Status | Comment |
---|---|---|
Web Audio API AudioScheduledSourceNode | Working Draft |
Browser compatibility
BCD tables only load in the browser
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论