Manipulate the system's audio devices
This module is based primarily on code from the previous incarnation of Mjolnir by Steven Degutis.
Signature | hs.audiodevice.allDevices() -> hs.audiodevice[] |
---|---|
Type | Function |
Description | Returns a list of all connected devices Parameters:
Returns:
|
Signature | hs.audiodevice.allInputDevices() -> audio[] |
---|---|
Type | Function |
Description | Returns a list of all connected input devices. Parameters:
Returns:
|
Signature | hs.audiodevice.allOutputDevices() -> hs.audiodevice[] |
---|---|
Type | Function |
Description | Returns a list of all connected output devices Parameters:
Returns:
|
Signature | hs.audiodevice.current([input]) -> table |
---|---|
Type | Function |
Description | Fetch various metadata about the current default audio devices Parameters:
Returns:
|
Signature | hs.audiodevice.defaultInputDevice() -> audio or nil |
---|---|
Type | Function |
Description | Get the currently selected audio input device Parameters:
Returns:
|
Signature | hs.audiodevice.defaultOutputDevice() -> audio or nil |
---|---|
Type | Function |
Description | Get the currently selected audio output device Parameters:
Returns:
|
Signature | hs.audiodevice.findDeviceByName(name) -> device or nil |
---|---|
Type | Function |
Description | Find an audio device by name Parameters:
Returns:
|
Signature | hs.audiodevice.findDeviceByUID(uid) -> device or nil |
---|---|
Type | Function |
Description | Find an audio device by UID Parameters:
Returns:
|
Signature | hs.audiodevice.findInputByName(name) -> device or nil |
---|---|
Type | Function |
Description | Find an audio input device by name Parameters:
Returns:
|
Signature | hs.audiodevice.findInputByUID(uid) -> device or nil |
---|---|
Type | Function |
Description | Find an audio input device by UID Parameters:
Returns:
|
Signature | hs.audiodevice.findOutputByName(name) -> device or nil |
---|---|
Type | Function |
Description | Find an audio output device by name Parameters:
Returns:
|
Signature | hs.audiodevice.findOutputByUID(uid) -> device or nil |
---|---|
Type | Function |
Description | Find an audio output device by UID Parameters:
Returns:
|
Signature | hs.audiodevice:allInputDataSources() -> hs.audiodevice.dataSource[] or nil |
---|---|
Type | Method |
Description | Gets all of the input data sources of an audio device Parameters:
Returns:
|
Signature | hs.audiodevice:allOutputDataSources() -> hs.audiodevice.dataSource[] or nil |
---|---|
Type | Method |
Description | Gets all of the output data sources of an audio device Parameters:
Returns:
|
Signature | hs.audiodevice:balance() -> number or nil |
---|---|
Type | Method |
Description | Get the current left/right balance of this audio device Parameters:
Returns:
Notes:
|
Signature | hs.audiodevice:currentInputDataSource() -> hs.audiodevice.dataSource object or nil |
---|---|
Type | Method |
Description | Gets the current input data source of an audio device Parameters:
Returns:
Notes:
|
Signature | hs.audiodevice:currentOutputDataSource() -> hs.audiodevice.dataSource object or nil |
---|---|
Type | Method |
Description | Gets the current output data source of an audio device Parameters:
Returns:
Notes:
|
Signature | hs.audiodevice:inputMuted() -> bool or nil |
---|---|
Type | Method |
Description | Get the Input mutedness state of the audio device Parameters:
Returns:
|
Signature | hs.audiodevice:inputVolume() -> number or nil |
---|---|
Type | Method |
Description | Get the current input volume of this audio device Parameters:
Returns:
Notes:
|
Signature | hs.audiodevice:isInputDevice() -> boolean |
---|---|
Type | Method |
Description | Determins if an audio device is an input device Parameters:
Returns:
|
Signature | hs.audiodevice:isOutputDevice() -> boolean |
---|---|
Type | Method |
Description | Determins if an audio device is an output device Parameters:
Returns:
|
Signature | hs.audiodevice:jackConnected() -> boolean or nil |
---|---|
Type | Method |
Description | Determines whether an audio jack (e.g. headphones) is connected to an audio device Parameters:
Returns:
|
Signature | hs.audiodevice:muted() -> bool or nil |
---|---|
Type | Method |
Description | Get the mutedness state of the audio device Parameters:
Returns:
Notes:
|
Signature | hs.audiodevice:name() -> string or nil |
---|---|
Type | Method |
Description | Get the name of the audio device Parameters:
Returns:
|
Signature | hs.audiodevice:outputMuted() -> bool or nil |
---|---|
Type | Method |
Description | Get the Output mutedness state of the audio device Parameters:
Returns:
|
Signature | hs.audiodevice:outputVolume() -> number or nil |
---|---|
Type | Method |
Description | Get the current output volume of this audio device Parameters:
Returns:
Notes:
|
Signature | hs.audiodevice:setBalance(level) -> bool |
---|---|
Type | Method |
Description | Set the balance of this audio device Parameters:
Returns:
Notes:
|
Signature | hs.audiodevice:setDefaultInputDevice() -> bool |
---|---|
Type | Method |
Description | Selects this device as the system's audio input device Parameters:
Returns:
|
Signature | hs.audiodevice:setDefaultOutputDevice() -> bool |
---|---|
Type | Method |
Description | Selects this device as the system's audio output device Parameters:
Returns:
|
Signature | hs.audiodevice:setInputMuted(state) -> bool |
---|---|
Type | Method |
Description | Set the mutedness state of the Input of the audio device Parameters:
Returns:
|
Signature | hs.audiodevice:setInputVolume(level) -> bool |
---|---|
Type | Method |
Description | Set the input volume of this audio device Parameters:
Returns:
Notes:
|
Signature | hs.audiodevice:setMuted(state) -> bool |
---|---|
Type | Method |
Description | Set the mutedness state of the audio device Parameters:
Returns:
Notes:
|
Signature | hs.audiodevice:setOutputMuted(state) -> bool |
---|---|
Type | Method |
Description | Set the mutedness state of the Output of the audio device Parameters:
Returns:
|
Signature | hs.audiodevice:setOutputVolume(level) -> bool |
---|---|
Type | Method |
Description | Set the output volume of this audio device Parameters:
Returns:
Notes:
|
Signature | hs.audiodevice:setVolume(level) -> bool |
---|---|
Type | Method |
Description | Set the volume of this audio device Parameters:
Returns:
Notes:
|
Signature | hs.audiodevice:supportsInputDataSources() -> boolean |
---|---|
Type | Method |
Description | Determines whether an audio device supports input data sources Parameters:
Returns:
|
Signature | hs.audiodevice:supportsOutputDataSources() -> boolean |
---|---|
Type | Method |
Description | Determines whether an audio device supports output data sources Parameters:
Returns:
|
Signature | hs.audiodevice:transportType() -> string |
---|---|
Type | Method |
Description | Gets the hardware transport type of an audio device Parameters:
Returns:
|
Signature | hs.audiodevice:uid() -> string or nil |
---|---|
Type | Method |
Description | Get the unique identifier of the audio device Parameters:
Returns:
|
Signature | hs.audiodevice:volume() -> number or nil |
---|---|
Type | Method |
Description | Get the current volume of this audio device Parameters:
Returns:
Notes:
|
Signature | hs.audiodevice:watcherCallback(fn) -> hs.audiodevice |
---|---|
Type | Method |
Description | Sets or removes a callback function for an audio device watcher Parameters:
Returns:
Notes:
|
Signature | hs.audiodevice:watcherIsRunning() -> boolean |
---|---|
Type | Method |
Description | Gets the status of the Parameters:
Returns:
|
Signature | hs.audiodevice:watcherStart() -> hs.audiodevice or nil |
---|---|
Type | Method |
Description | Starts the watcher on an Parameters:
Returns:
|
Signature | hs.audiodevice:watcherStop() -> hs.audiodevice |
---|---|
Type | Method |
Description | Stops the watcher on an Parameters:
Returns:
|