MartinMcD Posted August 3, 2010 Report Share Posted August 3, 2010 Hi there, I would like the user of my app to be able to select which audio device/soundcard to read from. At the moment I am just reading from Device 0. This works because Device 0 is the soundcard if no external device is plugged in and then any device I add is assigned to Device 0 instead. This is a bit limited though. I know there must be a Windows api call to get an enumerated list of the active devices (in fact the express vi for sound capture has just this list). Does anyone know how to do it please? Thanks very much, Martin Quote Link to comment
Shaun Hayward Posted August 3, 2010 Report Share Posted August 3, 2010 There's a really handy couple of VIs in vi.lib\sound2\lvsound.llb: 1. Get Num Devices - this lists the number of input and output devices in your system 2. Sound Device Info - returns the *NAME* of the sound device associated with a number I normally use #1 to set N on a for loop, and populate a ring control with the names out of #2. Shaun 2 Quote Link to comment
MartinMcD Posted August 4, 2010 Author Report Share Posted August 4, 2010 That's perfect, thank you very much for the help Shaun. Cheers, Martin Quote Link to comment
ekaetz Posted September 8, 2018 Report Share Posted September 8, 2018 (edited) Getting the audio devive list by using the function "SoundNumDevices" in lvsound2.dll only works once. If the devices on the PC change, and this function is called again, it always returns the same device list. It is as if this DLL obtains the device list form the PC when it is loaded (maybe a class is instantiated then). The only way to get an updated list is to relaunch your EXE or if in the dev enviroment to close all VIs that use sound tools in the dev project then open them again. Does any one know a way to refresh the audio device list without restarting the app (or closing and reloading the VI)? NOTE: I am using Labview 2017 SP1 Edited September 8, 2018 by ekaetz Quote Link to comment
Its Me Ashiq Posted September 6, 2021 Report Share Posted September 6, 2021 On 9/9/2018 at 4:54 AM, ekaetz said: Getting the audio devive list by using the function "SoundNumDevices" in lvsound2.dll only works once. If the devices on the PC change, and this function is called again, it always returns the same device list. It is as if this DLL obtains the device list form the PC when it is loaded (maybe a class is instantiated then). The only way to get an updated list is to relaunch your EXE or if in the dev enviroment to close all VIs that use sound tools in the dev project then open them again. Does any one know a way to refresh the audio device list without restarting the app (or closing and reloading the VI)? NOTE: I am using Labview 2017 SP1 Yeah that is really annoying!!! 😤😤😤😤 Quote Link to comment
dadreamer Posted September 6, 2021 Report Share Posted September 6, 2021 1 hour ago, It's Me said: Yeah that is really annoying!!! 😤😤😤😤 Maybe it's time to try WaveIO library written by Christian Zeitnitz then? Quote Link to comment
Its Me Ashiq Posted September 11, 2021 Report Share Posted September 11, 2021 Fortunately Dataflow G have released this toolkit - dataflowg/g-audio: An audio library for LabVIEW. (github.com) It satisfies all the requirements 🤩!!! 1 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.