LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically control sound device input levels on Windows

Solved!
Go to solution

I'm using the sound input VIs to record audio data from an input device (like microphone or line in). For convenience, I want to control the audio device input level (accessible in the Windows sound settings) via Labview:

 

inputlevel.png

 

Is there a way to access the recording/input volumes of Windows audio devices in Labview, maybe via a system dll or a .NET class available in Labview?

0 Kudos
Message 1 of 5
(1,327 Views)

Hi, 

 

You should take a look on this project : GitHub - dataflowg/g-audio: A LabVIEW audio library.

 

Loïc

0 Kudos
Message 2 of 5
(1,212 Views)

Thanks for the recommendation! I've looked into it and it's a really comprehensive audio library for Labview, but unfortunately it has a crucial flaw in how it handles input device volume. Apparently the volume is set after the capture and does not affect the actual input device pre-amp like the Windows record level volume does (the one I showed in the screenshot). That means if the pre-amp value (i.e. record level) is too high, the audio is clipped, and reducing the input volume through that audio library only scales down the already clipped audio. In contrast, using the Windows record level control reduces the actual pre-amp value in the driver and avoids clipping.

 

So what I need is a method to control the record level pre-capture, not scale the data post-capture.

0 Kudos
Message 3 of 5
(1,173 Views)
Solution
Accepted by topic author Novgorod

The WaveIO audio library can be used to set the input device volume via the Windows sound mixer. I'll look at adding that feature to G-Audio at some point in the future 🙂

Message 4 of 5
(1,143 Views)

Thanks for the feedback. The RecVolume function in the WaveIO.dll does exactly what I was looking for (controlling the record level via the Windows API). Strange that the miniaudio library which you use in your G-audio implementation doesn't support that (apparently) - I guess that's a limitation of being cross-platform.

0 Kudos
Message 5 of 5
(1,125 Views)