Interface RuntimeOptions

interface RuntimeOptions {
    autoUnlock?: boolean;
    createAudioWorkletNode?: ((context, name, options?) => any);
}

Properties

autoUnlock?: boolean

If true (the default), Cacophony installs one-time touchend / click / keydown listeners on document.body whenever the audio context is constructed in suspended state. The first user gesture resumes the context, plays a silent primer buffer (required by iOS Safari for the context to truly unlock), removes the listeners, and emits the unlock event on the Cacophony instance.

Set to false to opt out — you are then responsible for calling cacophony.resume() yourself in response to a user gesture.

Has no effect when the context is already running, on offline contexts, or in non-browser environments (document === undefined).

Default

true
createAudioWorkletNode?: ((context, name, options?) => any)

Type declaration

    • (context, name, options?): any
    • Parameters

      • context: BaseContext
      • name: string
      • Optional options: AudioWorkletNodeOptions

      Returns any