Solved

Get Current Mixer Volume (vb.net)

Posted on 2004-04-27
7
1,641 Views
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.

0
Comment
Question by:KeirGordon
  • 4
  • 3
7 Comments
 
LVL 37

Expert Comment

by:gregoryyoung
Comment Utility
Are you familiar with how to call a .dll from .net ?

I would suggest reading http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcallingdllfunction.asp and then using the API functions to call the API methods
0
 
LVL 37

Expert Comment

by:gregoryyoung
Comment Utility
err using the API methods

*do what I say not what I type*
0
 
LVL 5

Author Comment

by:KeirGordon
Comment Utility
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?
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 37

Accepted Solution

by:
gregoryyoung earned 500 total points
Comment Utility

http://support.microsoft.com/default.aspx?scid=kb;en-us;181550

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

Author Comment

by:KeirGordon
Comment Utility
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.

0
 
LVL 37

Expert Comment

by:gregoryyoung
Comment Utility
I'm running XP and they worked fine here.
0
 
LVL 5

Author Comment

by:KeirGordon
Comment Utility
I was working with the MSDN code you posted, I have no trouble opening the mixer, but I can not open the line:

    mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT;

    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.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now