Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with mixer API

Status
Not open for further replies.

fugigoose

Programmer
Jun 20, 2001
241
US
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top