如何在Windows CE 6.0 R3上P /调用WaveOut API?
当我把这个
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern MMRESULT waveOutOpen(ref IntPtr hWaveOut, int uDeviceID, ref WAVEFORMATEX lpFormat, DelegateWaveOutProc dwCallBack, int dwInstance, int dwFlags);
[DllImport("winmm.dll")]
public static extern MMRESULT waveInOpen(ref IntPtr hWaveIn, int deviceId, ref WAVEFORMATEX wfx, DelegateWaveInProc dwCallBack, int dwInstance, int dwFlags);
[DllImport("winmm.dll", SetLastError = true)]
public static extern MMRESULT waveInStart(IntPtr hWaveIn);
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern uint waveInGetDevCaps(int index, ref WAVEINCAPS pwic, int cbwic);
[DllImport("winmm.dll", SetLastError = true)]
public static extern uint waveInGetNumDevs();
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern uint waveOutGetDevCaps(int index, ref WAVEOUTCAPS pwoc, int cbwoc);
[DllImport("winmm.dll", SetLastError = true)]
public static extern uint waveOutGetNumDevs();
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern MMRESULT waveOutWrite(IntPtr hWaveOut, ref WAVEHDR pwh, int cbwh);
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern MMRESULT waveOutPrepareHeader(IntPtr hWaveOut, ref WAVEHDR lpWaveOutHdr, int uSize);
它可以在Windows XP 7上运行,但在Wnidows CE 6.0上抛出一条消息“无法P /调用winmm.dll”。
我究竟做错了什么? WaveOut API是否已移至其他dll或其他?
无论如何,SoundPlayer(来自.NET Compact Framework 3.5)都可以正常工作。
最佳答案
将winmm.dll更改为coredll.dll,您就完成了!
关于audio - 如何在Windows CE 6.0 R3上P/调用WaveOut API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14294930/