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() { ... });
double
specifying the suspend time.A Promise
resolving to void.
The promise is rejected when any exception is encountered.
InvalidStateError
if the quantized frame number is one of the following:
Specification | Status | Comment |
---|---|---|
Web Audio API The definition of 'suspend()' in that specification. | Working Draft | Initial definition. |
Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | 49 | Yes | No | No | 36 | No |
Feature | Android webview | Chrome for Android | Edge mobile | Firefox for Android | IE mobile | Opera Android | iOS Safari |
---|---|---|---|---|---|---|---|
Basic support | 49 | 49 | Yes | No | No | 36 | No |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/OfflineAudioContext/suspend