The following code illustrates using MCI_MIXSETUP to prepare the audio device for 16-bit, 22050 kHz, stereo mode.
memset( &MixSetupParms, '\0', sizeof( MCI_MIXSETUP_PARMS ) ); MixSetupParms.ulBitsPerSample = 16; MixSetupParms.ulFormatTag = MCI_WAVE_FORMAT_PCM; MixSetupParms.ulSamplesPerSec = 22050; MixSetupParms.ulChannels = 2; /* Stereo */ MixSetupParms.ulBitsPerSample = 16; MixSetupParms.ulFormatMode = MCI_PLAY; MixSetupParms.ulDeviceType = MCI_DEVTYPE_WAVEFORM_AUDIO; /* The mixer will inform us of entry points to */ /* read/write buffers to and also give us a */ /* handle to use with these entry points. */ MixSetupParms.pmixEvent = MyEvent; rc = mciSendCommand( usDeviceID, MCI_MIXSETUP, MCI_WAIT | MCI_MIXSETUP_INIT, ( PVOID ) &MixSetupParms, 0 );