beta
cables is under heavy development.
There might be one or another bug, please let us know about it!
Ops.WebAudio.WebAudioContextRunner

WebAudioContextRunner
op id:9e670541-deda-4eff-89bf-b6c56a917256
Resumes the Web Audio context (unmute on Chrome / iOS)

summary (oneliner)

Some browser have a strict autoplay policy. In Google Chrome and mobile iOS audio cannot be played unless the playback was initiated by a user gesture (click / tap). To free the audio context from the so called suspended state, a user interaction is needed which triggers the ResumeAudioContext op.
It has two modes – in the default one Show Overlay: true it will show an overlay over the cables canvas with a play button when the audio context is suspended.
When Show Overlay is set to false you have to manually take care of the user interaction (e.g. by adding a button yourself), registering a click / touch even listener and finally triggering Resume on this op.

doc

youtube id

collections

related ops

Inputs

Show Overlay (boolean Number)

Shows a button to unblock the audio context when set to true (only when it is blocked)


Resume (Function)

If Show Overlay is set to true you don’t need to connect this. It is only needed when set to false and needs to be manually triggered after a user interaction.


Outputs

Current State (string Number)

The current Web Audio state, updated whenever it changes (via event listener), either running or suspended


Credits

Caught a mistake or want to contribute to the documentation?


Edit this documentcancel save

Examples using WebAudioContextRunner

Public Patches using WebAudioContextRunner