Solved

Get Current Mixer Volume (vb.net)

Posted on 2004-04-27
7
1,692 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
ID: 10935254
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
ID: 10935256
err using the API methods

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

Author Comment

by:KeirGordon
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?
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 37

Accepted Solution

by:
gregoryyoung earned 500 total points
ID: 10940160

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

0
 
LVL 37

Expert Comment

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

Author Comment

by:KeirGordon
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:

    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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Call an IPL program from vb.net and pass in a file location parmeter 2 27
export data table to excel in vb.net 10 37
MailAddress in vb 4 29
Code enhancement 4 22
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

821 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