constusb = hs.audiodevice.findDeviceByName("USB Audio CODEC"); if (usb) usb.setDefaultOutputDevice();
Watching for system-level changes
Available events: "dOut" (default output changed), "dIn" (default input changed),
"dSErr" (default alert sound device changed), "dev+" (a device was added), "dev-"
(a device was removed). "dOut", "dIn" and "dSErr" listeners receive the new default
device (or null if there is none), "dev+" listeners the added device, and "dev-"
listeners an {id, uid, name} object describing the removed device, which can no longer
be used.
Module for discovering and controlling audio devices.
Finding devices
Selecting a device
Watching for system-level changes
Available events:
"dOut"(default output changed),"dIn"(default input changed),"dSErr"(default alert sound device changed),"dev+"(a device was added),"dev-"(a device was removed)."dOut","dIn"and"dSErr"listeners receive the new default device (ornullif there is none),"dev+"listeners the added device, and"dev-"listeners an{id, uid, name}object describing the removed device, which can no longer be used.