The problem section of my code looks like this:
HMIXER mixer;
UINT mDeviceID;
UINT nDevs;
UINT_PTR * prtID = &mDeviceID;
MIXERCAPS mCaps;
MIXERLINECONTROLS mControls;
MMRESULT ret;
MIXERCONTROLDETAILS cDetails;
MIXERLINE mLine;
WAVEFORMATEX waveFormat;
HWAVEOUT hWaveOut;
//Open Mixer
waveFormat.cbSize = sizeof(WAVEFORMATEX);
waveFormat.nChannels = 2;
waveFormat.wFormatTag = WAVE_FORMAT_PCM;
waveFormat.nSamplesPerSec = 44.10;
waveFormat.wBitsPerSample = 16;
waveFormat.nBlockAlign = waveFormat.nChannels * waveFormat.wBitsPerSample;
waveFormat.nAvgBytesPerSec = waveFormat.nBlockAlign * waveFormat.nSamplesPerSec;
ret = waveOutOpen(&hWaveOut, WAVE_MAPPER, &waveFormat, 0, 0, 0);
ret = mixerOpen(&mixer, hWaveOut, 0, 0, MIXER_OBJECTF_HWAVEOUT);
The problem happens when calling the mixerOpen() function. I'm trying to open the mixer for the waveOut device i opened using the retutned handle. MSDN says that if I use the flag MIXER_OBJECTF_HWAVEOUT, instead of the standard UINT for parameter 2, I can use a handler to a waveOut device. However, when running, I get the error:
"Cannot convert Struct HWAVEOUT to UINT!"
How am i supposed to use a handle if param two has to be a UINT! All I want to do is open the waveOut mixer. Mixer API has got to be the most confusing section of WinAPI.
HMIXER mixer;
UINT mDeviceID;
UINT nDevs;
UINT_PTR * prtID = &mDeviceID;
MIXERCAPS mCaps;
MIXERLINECONTROLS mControls;
MMRESULT ret;
MIXERCONTROLDETAILS cDetails;
MIXERLINE mLine;
WAVEFORMATEX waveFormat;
HWAVEOUT hWaveOut;
//Open Mixer
waveFormat.cbSize = sizeof(WAVEFORMATEX);
waveFormat.nChannels = 2;
waveFormat.wFormatTag = WAVE_FORMAT_PCM;
waveFormat.nSamplesPerSec = 44.10;
waveFormat.wBitsPerSample = 16;
waveFormat.nBlockAlign = waveFormat.nChannels * waveFormat.wBitsPerSample;
waveFormat.nAvgBytesPerSec = waveFormat.nBlockAlign * waveFormat.nSamplesPerSec;
ret = waveOutOpen(&hWaveOut, WAVE_MAPPER, &waveFormat, 0, 0, 0);
ret = mixerOpen(&mixer, hWaveOut, 0, 0, MIXER_OBJECTF_HWAVEOUT);
The problem happens when calling the mixerOpen() function. I'm trying to open the mixer for the waveOut device i opened using the retutned handle. MSDN says that if I use the flag MIXER_OBJECTF_HWAVEOUT, instead of the standard UINT for parameter 2, I can use a handler to a waveOut device. However, when running, I get the error:
"Cannot convert Struct HWAVEOUT to UINT!"
How am i supposed to use a handle if param two has to be a UINT! All I want to do is open the waveOut mixer. Mixer API has got to be the most confusing section of WinAPI.