LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading Computer Microphone Level Setting

Solved!
Go to solution

I have an application that uses the computer's audio card line in to record audio files from outputs provided from another source.  We have multiple systems that receive these audio inputs from different devices and each of these devices output their audio at different levels.  I have build a sequence of events that change the microphone level up or down to match the input to a known sample level.  This utilizes the WM APPCOMMAND to change the microphone volume, see attached VI.

 

What I am trying to do now is record the microphone level after my sequence so I can refer to it in the report afterwards.  The problem with the WM APPCOMMAND is that there is no feedback, I am only able to change it up and down from where it is at.

 

I have looked all over for examples and it appears that using the Mixer settings from Winmm.dll I should be able to get this information but everyone I try does not work.  From my reseach it appears that these might work for Windows XP but it changes in Windows VISTA and able.  We are running Windows 7.  The other issue I have with the examples is that they are all for setting the volume level and I want to explicitly read what level it is set to.

 

From my research I am trying to read the setting of the audio endpoint device and that it might be able to be done with dsound.dll or MMDevice API but I have not been able to figure out how to use either of these to do what I am trying to do.

 

I have looked all over the Internet and sepent more time on this then I shoudl have so I figured I would post it here to see if anyone else had any suggestions.

 

Thanks in advance.

0 Kudos
Message 1 of 3
(3,812 Views)

Hi wiltdavi,

 

Have you seen this: https://msdn.microsoft.com/en-us/library/windows/desktop/dd370793%28v=vs.85%29.aspx

 

There is a section about capturing from an external microphone which may be helpful. 

Julia P.
0 Kudos
Message 2 of 3
(3,757 Views)
Solution
Accepted by topic author wiltdavi

Julia,

 

Yeah, I had looked at that link and it is down the right path.  From all my research I had figured out that you needed to use MMDevices and Audio Endpoints but I could not figure out how to implement it.  One of my co-workers were able to help me with that.

 

I have attached the set of code required to make it work.  It is a nice little VI so give it a try and let me know what you think.

 

Something to note is I believe this will only work with Windows VISTA and above.

Message 3 of 3
(3,747 Views)