Read system volume control value

Hi Experts,
How to get my vb .net application to read the system volume control value ?
So i can set a volume control scroll bar lever in the correct position.
Thanks
LoGa1234567890Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MlandaTCommented:
You typically would use the GetMasterVolume and SetMasterVolume. The actual implementations get a bit complex, and I'd perhaps go by way of finding other examples and picking up what I need from them.

You might find this Planet Source Code example to have everything you need. Other nice examples are  Controlling sound volume in C# and Sound visualizer in C#.

A details discussion and example code on the matter can also be found here.

Some of the examples are in C#, but you can convert that to VB.NET quite easily at http://converter.telerik.com/
0
LoGa1234567890Author Commented:
Can not get any of them working.
I found this link:
http://www.vbforums.com/showthread.php?605042-RESOLVED-How-to-change-master-volume-level.
No error when run, but the value return always a maximum value.
Test with: TextBox1.Text = mixersetter.GetVolume()
0
MlandaTCommented:
I see it does the same here. I also just get 65535. Windows 10. I wonder whether this is Windows version specific? I came across a reference that indicated the Windows XP and Vista handled sound differently from the more recent versions. Most of the samples we have looked at are fairly old forums and samples (and hence earlier versions of Windows). I thought we might look at a library like http://naudio.codeplex.com/ or http://alvas.net/alvas.audio,tips.aspx#tip106 or the Direct X method (http://www.codeproject.com/KB/directx/volumemeter.aspx)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
LoGa1234567890Author Commented:
I found the link i posted do work now, its GetVolume() refer to the device loudspeaker, not system sound but it is ok for me.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

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.