Retrieves the name of a sound device or component.

Name := SoundGetName(Component, Device)



Type: String or Integer

The component's display name and/or index. For example, 1, "Line in" or "Line in:2".

If omitted or blank, the name of the device itself is retrieved.

For further details, see Component (Sound Functions).


Type: String or Integer

The device's display name and/or index. For example, 1, "Speakers", "Speakers:2" or "Speakers (Example HD Audio)".

If this parameter is omitted, it defaults to the system's default device for playback (which is not necessarily device 1).

For further details, see Device (Sound Functions).

Return Value

Type: String

The name of the device or component, which can be empty.

Error Handling

An exception is thrown on failure. The exception's Message property may contain one of the following:


Sound Functions



default_device := SoundGetName()
MsgBox 'The default playback device is "' default_device '".'

device1 := SoundGetName( , 1)
MsgBox 'Device 1 is "' device1 '".'

component1 := SoundGetName(1)
MsgBox 'Component 1 is "' component1 '".'

For a more complex example, see the soundcard analysis script.