Get Master Sound Volume in c#

后端 未结 7 1475
误落风尘
误落风尘 2020-11-28 09:57

I need to get the current volume of the output to the sound card.

Any ideas how?

7条回答
  •  死守一世寂寞
    2020-11-28 10:39

    I don't believe there is an easy way to get the current Peak under XP. MIXERCONTROL_CONTROLTYPE_PEAKMETER is present but I believe it is largely unsupported (it is on my current machine). I am guessing you will have create your own method of analysing the current audio output, have a look at the DSP section here.

    You can just decide at runtime which method you would like to use, XP and Vista/7 have very different methods of dealing with the audio. Some possibly useful information on this matter I wrote previously can be here.

    The MSDN documentation and Larry Osterman's (he is also a member on SO) blog are probably the 2 most useful sources for current windows audio infrastructure in my opinion.

提交回复
热议问题