recording



I am using iMX31 PDK board and using Windows CE6.0 for wave recording.
WaveInOpen() returns 0x00000020 with bad format.
DWORD dwChannels = 1;
DWORD dwBitsPerSample = 16;
DWORD dwSampleRate = 11025;
DWORD dwDeviceId = WAVE_MAPPER;

WAVEFORMATEX wfx;
wfx.cbSize = 0;
wfx.wFormatTag = WAVE_FORMAT_PCM;
wfx.wBitsPerSample = (WORD)
dwBitsPerSample;
wfx.nSamplesPerSec = dwSampleRate;
wfx.nChannels = (WORD) dwChannels;
wfx.nBlockAlign = wfx.nChannels *
wfx.wBitsPerSample / 8;
wfx.nAvgBytesPerSec = wfx.nBlockAlign * wfx.nSamplesPerSec;

Please help me.


.