cacophony
    Preparing search index...

    Interface RuntimeOptions

    interface RuntimeOptions {
        autoUnlock?: boolean;
        createAudioWorkletNode?: (
            context: BaseContext,
            name: string,
            options?: AudioWorkletNodeOptions,
        ) => any;
        logger?: CacophonyLogger;
        quiet?: boolean;
        resolveWorkletUrl?: (name: string, url: string) => string | Promise<string>;
    }
    Index
    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).

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

    Optional logger for Cacophony's host-side diagnostic output (the [cacophony/worklet] messages emitted while loading AudioWorklet modules, plus the "AudioWorklet not supported" warning).

    When provided, all such output is routed through this object instead of the global console. Useful for capturing or redirecting logs in Node / headless / CLI hosts. Takes precedence over RuntimeOptions.quiet.

    consoleLogger (forwards to console)

    quiet?: boolean

    If true, suppresses all of Cacophony's host-side diagnostic output by installing a no-op logger. Equivalent to passing logger: noopLogger.

    Ignored when an explicit RuntimeOptions.logger is also provided.

    false
    
    resolveWorkletUrl?: (name: string, url: string) => string | Promise<string>

    Optional hook to remap a worklet module URL just before it is handed to audioWorklet.addModule. Receives the worklet's WorkletModule.name and its default WorkletModule.url; return the URL to load (return url unchanged to keep the default).

    The library build inlines every worklet bundle as a base64 data: URL, which the browser loads directly but node-web-audio-api cannot resolve. The cacophony/node adapter installs a resolver here that points addModule at the bundle file on disk instead, so worklet-backed effects work headless. Has no effect in the browser, where the default is used.