|
-
August 10th, 2006, 11:51 AM
#1
Get master volume value
Here is a simple code to obtain a master volume value in Windows:
Code:
HMIXER hMixer;
MIXERLINE ml = {0};
memset (&ml, 0, sizeof (MIXERLINE));
// get a handle to the mixer device
result = mixerOpen(&hMixer, 0, 0, 0, MIXER_OBJECTF_HMIXER);
if (MMSYSERR_NOERROR == result)
{
ml.cbStruct = sizeof(MIXERLINE);
ml.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS;
// get the speaker line of the mixer device
result = mixerGetLineInfo((HMIXEROBJ) hMixer, &ml,
MIXER_GETLINEINFOF_COMPONENTTYPE);
.......................
}
the mixer is opened OK. But I get MMSYSERR_INVALPARAM error on the bold line.
This code works perfectly on all machines but one. That computer has a built-in sound card from Realtek.
Does anyone know why it could happen?
Thanks a lot.
-
May 15th, 2012, 04:58 AM
#2
Re: Get master volume value
Have you been able to find a solution to this? I'm facing the same problem and I too have a Realtek soundcard.
Thanks.
-
May 15th, 2012, 05:51 AM
#3
Re: Get master volume value
I doubt that he's still monitoring this thread after 6 years!
You should open a new thread for this question.
Be sure to rate those who help!
-------------------------------------------------------------
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
-
May 16th, 2012, 12:02 AM
#4
Re: Get master volume value
In addition to krmed, when you provide the code snippet, please make sure that it can effectively reproduce the issue that you are having.
As for MMSYSERR_INVALPARAM, according to MSDN, it indicates that
One or more parameters are invalid.
Therefore, which parameter is exactly not right, you can figure out best without anything concrete for others to take a look.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|