audio - 如何在Windows CE 6.0 R3上P/调用WaveOut API

标签 audio pinvoke windows-ce waveout waveoutwrite

如何在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/

相关文章:

c# - 我如何在编译期间从 C# 调用未知的 native 函数

C# StringWriter 比 C++ ofstream 更快(通过 pinvoke)?

java - Android - 计算 FFT 后频率不正确

c# - .NET SoundPlayer问题

c# - 有没有办法在C#中获取extern方法的函数指针

visual-studio-2008 - WinCE 7.0 的平台生成器

c++ - Win CE 7平台上的错误c2039和错误c2873

windows-ce - 适用于 Windows CE 的廉价开发板

audio - 为什么AudioSource无法播放?

audio - 开始音频编程的最佳方式?