 |
|
 |
hi
i want to play two sound file same time and want to listen the sound of these file
on separtly on left and right speaker,means sound of one file should play on left
speaker and second file should play on right speaker
thank u in advance
malik
malik
|
|
|
|
 |
|
 |
Hi,
I would like to know what if there is no default Mixer available on the computer??!!
Would we still be able to make use of available channels to record audio from multiple channels?
|
|
|
|
 |
|
 |
Now I want to choose FrontPanel MIC or BackPanel MIC to recorde sound. My mixer panel have two item, but WireType only is MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE. So I only can control FrontPanle MIC using MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE. Can you help me?
|
|
|
|
 |
|
 |
I have resolved it. Thank you!
|
|
|
|
 |
|
 |
Please. I'd like to know how to choose frontpanel mic or backpanel mic..
|
|
|
|
 |
|
 |
I have made a new version that fixes some of the bugs and makes the functions a little bit more complete - but slightly more difficult to use.
They are located at:
http://donotspam.sent.com/alexfMixer/
This is how you use it:
CAlexfMixer mixer1(MIXERLINE_COMPONENTTYPE_DST_SPEAKERS ,
NO_SOURCE, MIXERCONTROL_CONTROLTYPE_VOLUME );
DWORD *results = NULL;
/* get the results of the speaker volume for BOTH speakers */
DWORD numOfChannels = mixer1.GetControlValue(&results);
delete [] results;
/* turn off the right speaker */
DWORD d[2];
d[0] = 0xffffffff;
d[1] = 0;
mixer1.SetControlValue(d,2);
I tried email the author but his email was dead.... *shrug*
enjoy!
-Rob
|
|
|
|
 |
|
 |
Great Article. 5 star!
I have looked at your code and I will be borrowing ideas from your hard work.
I was wondering if you will have an insight into the problem am trying to solve. I am working on project and one of the requirement is for the application to have a setting "Pause and mute sound from other application" as checkbox that a use can select. When enable, only sounds from my applicaiton will be heard, but sounds from other application are muted or pause if they have started playing already.
When I use your mixer to test the mute, it mutes sound for the entire system. How can I make it to allow my application but mute or pause all other application?
Do you know how to do this? Anyone else can contribute to help me out.
Suntai
We can't stop asking "WHY!!"
|
|
|
|
 |
|
 |
<<previous code -> fault code>>
BOOL CAlexfMixer::SetControlValue(DWORD dw)
{
if (!m_bSuccess) return m_bSuccess;
m_bSuccess = FALSE;
MIXERCONTROLDETAILS mxcd;
MIXERCONTROLDETAILS_UNSIGNED mxcd_u;
mxcd.cbStruct = sizeof(mxcd);
mxcd.dwControlID = m_iMixerControlID;
mxcd.cChannels = m_dwChannels;
mxcd.cMultipleItems = 0;
mxcd.cbDetails = sizeof(mxcd_u);
mxcd.paDetails = &mxcd_u;
mmr = mixerGetControlDetails((HMIXEROBJ)m_HMixer, &mxcd, 0L);
if (MMSYSERR_NOERROR != mmr) return m_bSuccess;
mxcd_u.dwValue = dw;
mmr = mixerSetControlDetails((HMIXEROBJ)m_HMixer, &mxcd, 0L);
if (MMSYSERR_NOERROR != mmr) return m_bSuccess;
m_bSuccess = TRUE;
return m_bSuccess;
}
<<previous code -> correct code>>
BOOL CAlexfMixer::SetControlValue(DWORD dw)
{
if (!m_bSuccess)
return m_bSuccess;
m_bSuccess = FALSE;
MIXERCONTROLDETAILS mxcd;
MIXERCONTROLDETAILS_UNSIGNED mxcd_u;
mxcd.cbStruct = sizeof(mxcd);
mxcd.dwControlID = m_iMixerControlID;
mxcd.cMultipleItems = 0;
mxcd.cbDetails = sizeof(mxcd_u);
mxcd.paDetails = &mxcd_u;
for(int i = m_dwChannels; i >= 0; i--) // 0:center, 1:right, 2:left
{
mxcd.cChannels = i;
mmr = mixerGetControlDetails((HMIXEROBJ)m_HMixer, &mxcd, 0L);
if (MMSYSERR_NOERROR != mmr)
return m_bSuccess;
mxcd_u.dwValue = dw;
mmr = mixerSetControlDetails((HMIXEROBJ)m_HMixer, &mxcd, 0L);
if (MMSYSERR_NOERROR != mmr)
return m_bSuccess;
}
m_bSuccess = TRUE;
return m_bSuccess;
}
Reason
The variable name mxcd.cChannels is OutSpeaker channel.
so, channel total counting and count number setting volume.
|
|
|
|
 |
|
 |
My Email Is peposi@mainone.com.cn .
a new guy of c++
|
|
|
|
 |
|
 |
I do not know why,but I can not download you source code.can you Email it to me,I really need it!also for anybody else,if you read this mesage,thank you so much!
a new guy of c++
|
|
|
|
 |
|
 |
I am trying to get the peak meter data but its not working. After creating the object when I call isOK() method it returns FAlSE.
Here is the call that I am making:
CAlexfMixer mixer(MIXERLINE_COMPONENTTYPE_DST_SPEAKERS,
NO_SOURCE, MIXERCONTROL_CONTROLTYPE_UNSIGNEDMETER );
I am running Windows 2000 Server. I have a sound card with mixer in it. The volume control works but meters are not working
Please help me.
|
|
|
|
 |
|
 |
your card doesn't necessarily support speaker level monitoring.
infact, most don't.
last time I saw this functionality was on sb16 cards.
|
|
|
|
 |
|
 |
Sorry, my language is not English.
I will control microphone loudness.
Other sound card ( AC97, SoundMAX...) is doing well.
But, Sound Blaster is NOT..
Please resolve my question..
|
|
|
|
 |
|
 |
Are you having more than on soundcard installed in your system ?
Because if you do this code will probably only modify mixer settings for the default soundcard.
|
|
|
|
 |
|
 |
Hi,
I had the same balance problem as mentioned in an earlier thread. Whenever i changed the volume the balance fader jumped to the left and stayed there.
After comparing with some other volume tools I changed a line in the SetControlValue function. I changed the line
mxcd.cChannels = m_dwChannels;
into
mxcd.cChannels = 1;
Apparently this could have something to do with Master volume being the first mixer or so. Could someone confirm this?
Geert J.
|
|
|
|
 |
|
 |
By the way,
I found this by looking at the volume control app of Bill Oats. Credit to him!;)
Geert J.
|
|
|
|
 |
|
 |
passing dwChannels to the winmm functions also assumed that the correct number of channels was specified in the mxcd_u structure in
the sample code.
Under vs.net 2003, this generated stack corruption in SetControlValue() code.
Setting cChannels to 1 in both GetControlValue and SetControlValue solved this problem.
|
|
|
|
 |
|
 |
Basically, it works like this:
1) controls which have the UNIFORM flag set (found by ANDing the controlType with &H1) have only one adjustable channel. Take DST_SPEAKERS, for example, (usually) 2 channels, but one adjustable mute control for both channels
2) If you set only the first structure for a control, (controls are set by the number of items AND the number of channels for non-UNIFORM controls) all items and channels are set to that value, regardless of the number of each of these
3) By changing the cchannels to 1, you can 'force' it to return one structure (by the way, also change the 'item' to 1) - however, even returning all shouldn't crash VS.NET.
Likely, you are assigning the amount of memory (the pamctrl, I believe) using AllocHGlobal to only the size of the structure. To remedy this, allocate the structureSize*numChannels*numItems memory. You can set up a loop to grab all the structures with PtrToStructure by offsetting the ptr address by the structure size for each sequential mixercontroldetails_xxxx structure to contruct a managed array (unsafe, but works)
This is off the top of my head, but if anyone has any questions or corrections, feel free to comment
Happy windows API coding :->
EDIT: sorry, I'm thinking about this in a managed environment, I'll leave it for info as the proposed solution should still be revlevant
-- modified at 23:26 Sunday 25th June, 2006
|
|
|
|
 |
|
 |
Hi ...
Anybody knows how to deal with the mixer callback using this class? I used this class at MFC CDialog class. Should I register the mixer messages first? A sample code or web reference will be appreciated.
Thanks
Richard J.O
|
|
|
|
 |
|
|
 |
|
 |
I See in this tip “GREAT! And yet so simple! Amazing”! I know! thank you very much!
|
|
|
|
 |
|
 |
Hello.
I am writing a simple util for my laptop. I miss the handy "Volume up/down" and "mute"-buttons on this one. So I'm setting up a global keyhook for ALT-F10-F12 and that works just great. Except one thing. After muting the sound (with ALT-F12) I press the keycombination again, but nothing happens. It does not unmute. I just don't get it. Here's a code snippet from my DLL:
**STUFF**
if(wParam==VK_F12) {
CAlexfMixer mixer(MIXERLINE_COMPONENTTYPE_DST_SPEAKERS, NO_SOURCE, MIXERCONTROL_CONTROLTYPE_MUTE);
if (!mixer.GetControlValue()) {
if(!mixer.SetControlValue(0)) MessageBox(NULL, "failed", "mixer on", MB_OK);
} else {
if(!mixer.SetControlValue(1)) MessageBox(NULL, "failed", "mixer off", MB_OK);
}
}
**MORE STUFF **
The mute code is more or less example code. Except I'm not using mixer.On() or mixer.Off(), of course I've tried those two though.
Appreciate any help.
Jonas
|
|
|
|
 |
|
 |
Gah. Got that to work with some fiddling around. (using MIXERCONTROLDETAILS_BOOLEAN in mixer.On()/Off()) and some other stuff). But now I'm having trouble with the volume instead
When I set a new volume value it fiddles around with the panning control too. What's up with that?
else if(wParam==VK_F10) {
CAlexfMixer mixer(MIXERLINE_COMPONENTTYPE_DST_SPEAKERS,
NO_SOURCE, MIXERCONTROL_CONTROLTYPE_VOLUME);
unsigned short val = mixer.GetControlValue();
if (val-3000<0 || val-3000>65535) val=0;
else val -= 3000;
mixer.SetControlValue(val);
}
And yes, I have tried with several other datatypes from DWORD to int to shorts. Even tried zeroing all bits except lower 16 or upper 16. ETC ETC.
What can I do?
Thanks
Jonas
|
|
|
|
 |
|
 |
How can i change the status from the mute check box for the wave control:;)
|
|
|
|
 |
|
 |
CAlexfMixer mixer(hWnd, MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT ,
NO_SOURCE, MIXERCONTROL_CONTROLTYPE_MUTE);
if (mixer.IsOk()) {
mixer.Off();
//mixer.On(); to unmute?
}
|
|
|
|
 |