SoundGetMute

Retrieves a mute setting of a sound device.

Setting := SoundGetMute(Component, Device)

Parameters

Component

Type: String or Integer

If blank or omitted, it defaults to the master mute setting. Otherwise, specify the component's display name and/or index, e.g. 1, "Line in" or "Line in:2".

For further details, see Component (Sound Functions).

Device

Type: String or Integer

If blank or omitted, it defaults to the system's default device for playback (which is not necessarily device 1). Otherwise, specify the device's display name and/or index, e.g. 1, "Speakers", "Speakers:2" or "Speakers (Example HD Audio)".

For further details, see Device (Sound Functions).

Return Value

Type: Integer (boolean)

This function returns 0 (false) for unmuted or 1 (true) for muted.

Error Handling

A TargetError is thrown if the device or component could not be found or if the component does not support this control type. Otherwise, an OSError is thrown on failure.

Remarks

To discover the capabilities of the sound devices installed on the system -- such as the names and available components -- run the soundcard analysis script.

Sound Functions

Examples

Checks whether the default playback device is muted.

master_mute := SoundGetMute()
if master_mute
    MsgBox "The default playback device is muted."
else
    MsgBox "The default playback device is not muted."

Checks whether "Line In pass-through" is muted.

if SoundGetMute("Line In") = 0
    MsgBox "Line In pass-through is not muted."

Checks whether the microphone (recording) is muted.

if SoundGetMute( , "Microphone") = 0
    MsgBox "The microphone (recording) is not muted."