Get Current Mixer Volume (

Posted on 2004-04-27
Last Modified: 2012-06-27
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.

Question by:KeirGordon
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 37

Expert Comment

ID: 10935254
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
LVL 37

Expert Comment

ID: 10935256
err using the API methods

*do what I say not what I type*

Author Comment

ID: 10939663
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?
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 37

Accepted Solution

gregoryyoung earned 500 total points
ID: 10940160;en-us;181550

shows how to do it in C++ call the same API calls from .net

Author Comment

ID: 10952613
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.

LVL 37

Expert Comment

ID: 10978787
I'm running XP and they worked fine here.

Author Comment

ID: 10979097
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.

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question