Volume Control through program....
-
hi all, Is there an Api through which i can control the "volume control balance" which appears in the dialog box which appears when we double click the sound icon in the systray. thanking and regards, ashwath.
-
hi all, Is there an Api through which i can control the "volume control balance" which appears in the dialog box which appears when we double click the sound icon in the systray. thanking and regards, ashwath.
-
Thank you very much for the help. Is there a method to actually mute the volume by checking the "muteall" checkbox from program.
-
Thank you very much for the help. Is there a method to actually mute the volume by checking the "muteall" checkbox from program.
ashwath2005 wrote: Is there a method to actually mute the volume by checking the "muteall" checkbox from program. Sure, just use a
MIXERCONTROL_CONTROLTYPE_MUTE
control type.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
-
ashwath2005 wrote: Is there a method to actually mute the volume by checking the "muteall" checkbox from program. Sure, just use a
MIXERCONTROL_CONTROLTYPE_MUTE
control type.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
In the code below ,where should i use the "MIXERCONTROL_CONTROLTYPE_MUTE" control type.Kindly let me know. MMRESULT result; HMIXER hMixer; result = mixerOpen(&hMixer, MIXER_OBJECTF_MIXER, 0, 0, 0); //obtain a handle to the mixer device. //we need to get the speaker line of the mixer device MIXERLINE ml = {0}; ml.cbStruct = sizeof(MIXERLINE); ml.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS; result = mixerGetLineInfo((HMIXEROBJ) hMixer,&ml, MIXER_GETLINEINFOF_COMPONENTTYPE); //we need to get the volume control of the speaker line. MIXERLINECONTROLS mlc = {0}; MIXERCONTROL mc = {0}; mlc.cbStruct = sizeof(MIXERLINECONTROLS); mlc.dwLineID = ml.dwLineID; mlc.dwControlType = MIXERCONTROL_CONTROLTYPE_VOLUME ; mlc.cControls = 1; mlc.pamxctrl = &mc; mlc.cbmxctrl = sizeof(MIXERCONTROL); result = mixerGetLineControls((HMIXEROBJ) hMixer, &mlc, MIXER_GETLINECONTROLSF_ONEBYTYPE); //MIXERCONTROL_CONTROLTYPE_VOLUME //set the volume level MIXERCONTROLDETAILS mcd = {0}; MIXERCONTROLDETAILS_UNSIGNED mcdu = {0}; mcdu.dwValue = iVal; // the volume is a number between 0 and 65535 mcd.cbStruct = sizeof(MIXERCONTROLDETAILS); mcd.hwndOwner = 0; mcd.dwControlID = mc.dwControlID; mcd.paDetails = &mcdu; mcd.cbDetails = sizeof(MIXERCONTROLDETAILS_UNSIGNED); mcd.cChannels = 1; result = mixerSetControlDetails((HMIXEROBJ) hMixer, &mcd, MIXER_SETCONTROLDETAILSF_VALUE);
-
In the code below ,where should i use the "MIXERCONTROL_CONTROLTYPE_MUTE" control type.Kindly let me know. MMRESULT result; HMIXER hMixer; result = mixerOpen(&hMixer, MIXER_OBJECTF_MIXER, 0, 0, 0); //obtain a handle to the mixer device. //we need to get the speaker line of the mixer device MIXERLINE ml = {0}; ml.cbStruct = sizeof(MIXERLINE); ml.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS; result = mixerGetLineInfo((HMIXEROBJ) hMixer,&ml, MIXER_GETLINEINFOF_COMPONENTTYPE); //we need to get the volume control of the speaker line. MIXERLINECONTROLS mlc = {0}; MIXERCONTROL mc = {0}; mlc.cbStruct = sizeof(MIXERLINECONTROLS); mlc.dwLineID = ml.dwLineID; mlc.dwControlType = MIXERCONTROL_CONTROLTYPE_VOLUME ; mlc.cControls = 1; mlc.pamxctrl = &mc; mlc.cbmxctrl = sizeof(MIXERCONTROL); result = mixerGetLineControls((HMIXEROBJ) hMixer, &mlc, MIXER_GETLINECONTROLSF_ONEBYTYPE); //MIXERCONTROL_CONTROLTYPE_VOLUME //set the volume level MIXERCONTROLDETAILS mcd = {0}; MIXERCONTROLDETAILS_UNSIGNED mcdu = {0}; mcdu.dwValue = iVal; // the volume is a number between 0 and 65535 mcd.cbStruct = sizeof(MIXERCONTROLDETAILS); mcd.hwndOwner = 0; mcd.dwControlID = mc.dwControlID; mcd.paDetails = &mcdu; mcd.cbDetails = sizeof(MIXERCONTROLDETAILS_UNSIGNED); mcd.cChannels = 1; result = mixerSetControlDetails((HMIXEROBJ) hMixer, &mcd, MIXER_SETCONTROLDETAILSF_VALUE);
My article has been updated with this information. Check it out.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb