suspend - Web API 接口参考 编辑
The suspend()
method of the OfflineAudioContext
interface schedules a suspension of the time progression in the audio context at the specified time and returns a promise. This is generally useful at the time of manipulating the audio graph synchronously on OfflineAudioContext.
Note that the maximum precision of suspension is the size of the render quantum and the specified suspension time will be rounded down to the nearest render quantum boundary. For this reason, it is not allowed to schedule multiple suspends at the same quantized frame. Also scheduling should be done while the context is not running to ensure the precise suspension.
语法
OfflineAudioContext.suspend(suspendTime).then(function() { ... });
参数
- 暂停时间
- A
double
指定暂停的时间.
返回值
A Promise
resolving to void.
异常
发生任何异常,promise就会拒绝.
如果帧数出现下列情况,就会抛出错误InvalidStateError
:
- 一个负值
- 小于或等于当前时间
- 大于或等于渲染的总渲染时间
- is scheduled by another suspend for the same time
Specifications
Specification | Status | Comment |
---|---|---|
Web Audio API suspend() | Working Draft | Initial definition. |
Browser compatibility
We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | 49.0 |
Feature | Android | Android Webview | Firefox Mobile (Gecko) | Firefox OS | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|---|
Basic support | 未实现 | 49.0 | 49.0 |
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论