hammerspoon2-docs
    Preparing search index...

    Function on

    • Register a listener for a named system-level audio configuration event.

      Parameters

      • event: "dOut" | "dIn" | "dSErr" | "dev+" | "dev-"

        The event to listen for

      • listener: (
            device: HSAudioDevice | { id: number; name: string; uid: string } | null,
        ) => void

        Called when the event occurs. For "dOut", "dIn" and "dSErr" it is passed the new default device (or null if there is none), for "dev+" the device that was added, and for "dev-" an {id, uid, name} object describing the device that was removed (it can no longer be used)

      Returns void

      Throws an Error on failure; wrap calls in try/catch to handle it.