You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 698e8f0
Browse filesBrowse the repository at this point in the historyBrowse files
feat(audio-context): OfflineAudioContext suspend(when) and resume() (#278)
* feat(audio-context): OfflineAudioContext suspend(when) and resume()
OfflineAudioContext.suspend(when) and resume() on iOS, Windows and
Linux, as in browsers. A suspend holds rendering at `when` rounded up to
a 128-frame quantum; changes made before resume() apply from that frame.
Suspends can be scheduled before startRendering() or while held.
Windows and Linux:
- web-audio-api only takes suspends scheduled before rendering starts. A
hidden worklet processor holds the render thread at each requested
quantum until resume(), and posts an event so the offline loop applies
the control messages queued meanwhile.
- The offline context's state is kept in JS (startRendering, suspends,
resume, completion) rather than taken from engine events.
- Unconnected AudioWorklet inputs are empty, as in browsers
(web-audio-api's spec-compliant-worklet-inputs).
iOS:
- The main-thread render loop stops at a suspend frame and pauses the
engine until resume().
- Worklets don't queue requests past the next suspend, so changes made
while held reach the Worker too.
- A node connected after rendering started rendered 2 frames late and
3 dB loud: an initialized mixer keeps a new input bus at its 44.1 kHz
stereo default. The engine now stops before such a connect and
restarts for the next quantum. Stopping keeps the sample time but
clears effect state; the README notes it.
- Node start() no longer starts an offline engine; only rendering does.
* fix(audio-context): iOS offline worklets render with no suspend scheduled
With no suspend scheduled the suspend set is nil, and messaging nil gave a
look-ahead limit of 0, so a source worklet never queued a request and
rendered silence after a 5 s stall. Adds a spec: a worklet source renders
offline, and a param set while held applies from the suspend frame.
* chore(demo): iOS runtime 9.1.0 for AudioWorklet specs
The worklet scope runs as a plain script in a Worker and polls its rings
with setInterval. 9.0.4-next gives such Workers no timers, so addModule
rejected; 9.1.0 has them. The README notes the requirement.
0 commit comments