# Master Volvme Control in VB.NET



## Popa Mintin (Jun 25, 2008)

Since last March I've been trying to discover how to read the master audio volume setting using VB.NET

I'm writing an alarm clock function and would like to be able to: -

Record the current Audio Volume setting, 
Change it (up or down), 
Play the 'Alarm Clock.wav' file then, 
Return it to it's original level.

I've learned how to increase and decrease the master volume but I'm currently having to increase the volume buy a set amount 
(at the moment 80%), then I play my .wav file... Then reduce the volume by the same amount... which is fine while ever the volume 
is originally set very low or off, but if the volume had been set higher than 20%, it will have stopped increasing when it got to 100% 
and then would have been turned down (in this case) to 20% which is a bit crude, but ok as far it goes but nevertheless a nuisance. 

Can anyone tell me how to read the set volume using VB.NET ? It'll be simple to do what I want if only I could read the set volume.

Poppa.


----------



## Popa Mintin (Jun 25, 2008)

Hi Guys, I'm still struggling with this problem.

I've now spent many more hours trying to pick out the part of a posted code that will do the trick for me, sadly without success, it doesn't help that everything changed with the release of Vista, and (I believe) again with the release of Win.7 so that anything posted prior to that isn't relevant.

Surely there must be somewhere a straightforward way to read the current setting of the Master Volume, it's obvious to me that 'straightforward' might be stretching a point but somewhere to start would be nice.

I could post reams of examples of code that is supposed to access the Master Volume setting, but they all come with supposed Get Volume, Set Volume, Set Slider, Set / UnSet Mute, display this, display that, none of which work I might add. Trying to pick out the 'Get Volume' part has proven to be a non-starter, especially the 'Master Volume' part as opposed to this sound track or that track, this channel, that channel... It always seems to be wrapped up in some other function and usually addressed by '0,0,0,0' with no documented explanation.

Can someone please point me to where I can discover how to (just) *read* the Current Master Volume setting.

Popa.


----------

