How Can I Get the Sound Device ID and Sound Device Name?

Updated May 31, 2023

Reported In

Software

  • LabVIEW

Issue Details

I would like to list all my sound devices and their Device IDs that are needed for the Sound Output Configure.vi/Sound Input Configure.vi/Play Sound File.vi. How can I achieve that?

Solution

To acquire device names and IDs, you could make use of the Sound Device Info.vi, which is located under \LabVIEW XXXX\vi.lib\sound2\lvsound2.llb. The example below shows one way of achieve this.

The "isInput?" bool option provides the user with the ability switch between listings of either input (such as microphones) IDs or output (such as speakers or headphone) IDs.  
 
Sound device ID.png
Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW block diagram.

Additional Information

The Device IDs would be in the range of 0 to n-1, n being the number of devices recognized in the Audio input and outputs section.

The 'Acquire Sound' Express VI  that comes installed with LabVIEW can also be used to examine which are the  devices that are recognized.