Get Current Mixer Volume (

I am trying to display the current volume level of audio playing on my computer.

Not the level to which the volume is set, but the level (how loud) the audio that is currently playing is.

To further simplify, I really just need to get a boolean which tells me whether or not there is any sound playing on the system.

This needs to be a .net solution (any .net language is fine) ... There are many solution in MSDN and on the internet using windows api's to return a mixer but none of them appear to work with Windows XP and .net.

Thanks in advance.

Who is Participating?
gregoryyoungConnect With a Mentor Commented:;en-us;181550

shows how to do it in C++ call the same API calls from .net
Are you familiar with how to call a .dll from .net ?

I would suggest reading and then using the API functions to call the API methods
err using the API methods

*do what I say not what I type*
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

KeirGordonAuthor Commented:
Yes, i've tried GetWaveOutVolume, and GetWaveOutPitch, and a mass of other functions available in the winmm.dll but none are helping me... what i've tried atleast only works when you open the waveout programatically..... but is not useful if you are trying to see if any other application is playing audio.   Just need to know if there is any audio playing at all, maybe a way to see the number of currently open wave devices or something?
KeirGordonAuthor Commented:
As I was saying, those API's do not work with windows XP.  I don't know exactly why.  But i d/l and ran that executable and it gives no reading.  I tried on several machines.

I'm running XP and they worked fine here.
KeirGordonAuthor Commented:
I was working with the MSDN code you posted, I have no trouble opening the mixer, but I can not open the line:


    rc = mixerGetLineInfo(( HMIXEROBJ )hMixer, &mxl, MIXER_GETLINEINFOF_COMPONENTTYPE);
    if (MMSYSERR_NOERROR == rc) {
       printf("couldn't open line");

I also tried opening the DST_WAVEIN line.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.