最近用wm9712做了一个录音,搞了一个测试程序,在
if (waveInOpen(&m_hWaveIn,WAVE_MAPPER,&m_WaveFormatEx,(DWORD)WaveInProc,NULL,CALLBACK_FUNCTION) != MMSYSERR_NOERROR )
{
RETAILMSG(OPEN, (TEXT(" record->waveInOpen is = %d; ! //modify by pinery20090605! \r\n"), waveInOpen(&m_hWaveIn,WAVE_MAPPER,&m_WaveFormatEx,(DWORD)WaveInProc,NULL,CALLBACK_FUNCTION) ));
goto END;
}
的时候返回错误,错误类型为4,我查了一下pb的帮助文档,意思是MMSYSERR_ALLOCATED :
The driver determines the number of clients that it enables to use a particular device. If a device is opened by the maximum number of clients, the driver returns MMSYSERR_ALLOCATED for subsequent open requests.
As of Windows CE .NET 4.0, the WAV API supports multiple streams per driver. In the past, only one stream per driver was opened, so many drivers did not keep track of their open or closed state.
With the addition of this technology, the driver is responsible for verifying that it is open or closed. If a driver supports only a single stream, the WODM_OPEN or WIDM_OPEN messages will fail with a return value of MMSYSERR_ALLOCATED.
上面这段话是微软的Developing a Device Driver > Windows CE Drivers > Audio Drivers > Audio Driver Samples下的,另外音频的三种驱动方式,mdd/pdd架构,wavedev2,uam模式,如果是mdd/pdd的驱动好象是不支持多个应用的,不知道是不只这个,驱动原形是别人提供的,还的仔细分析一下