smork

Hello,

I can't seem to figure out how to get Windows Vista master volume level and mute status. Searches have not brought up all that much help. It seems the way volume changed from XP to Vista makes all of the solutions I've found not work. (a P/Invoke sample I found on the site seems to be reporting/adjusting its own volume level and not master.)

I'm not looking to change these values, I just want to know what they are at a given time in my application.



Re: Visual C# General How do I get master sound volume and mute status?

JohnWein

I'm pretty sure that you will have to use Winmm.dll to get the master volume. The Vista audio API doesn't provide access to the primary buffer. Mixapp.exe will give you the Control ID's for the volume and mute.





Re: Visual C# General How do I get master sound volume and mute status?

smork

This is my first windows forms usage of C# and well I have been stuck on this now for days. There doesn't seem to be much info available. Mixapp.exe just does the same thing everything else does, report what it thinks is master, but in Vista it is just application volume.

I think I need to get the values from an endpoint device:
http://msdn2.microsoft.com/en-us/library/ms678705.aspx

But I don't know how to get that.




Re: Visual C# General How do I get master sound volume and mute status?

Ji Cheng Wang - MSFT

Hi smork,

If you would like to get Vista master volume and mute status, I suggest you to check out this thread about "Vista Master Volume Control with C#" for reference - http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1287868&SiteID=1

Hope this helps,

Regards,






Re: Visual C# General How do I get master sound volume and mute status?

smork

Thanks, that is exactly what I needed.