大家看下这个音频API函数waveInPrepareHeader的调用有什么问题
// 定义结构体TWaveHdr
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TWaveHdr
{
public unsafe char* lpData;
public int dwBufferLength;
public int dwBytesRecorded;
public int dwUser;
public int dwFlags;
public int dwLoops;
public int lpNext;
public int reserved;
}
//预先调配音频输入缓冲区
[DllImport("winmm.dll",EntryPoint="waveInPrepareHeader",CharSet=CharSet.Auto)]
public static extern int waveInPrepareHeader(IntPtr hwi, ref TWaveHdr pwh, int cbwh);
//调用
int err_ms = VideoClass.waveInPrepareHeader(phwi, ref thd, System.Runtime.InteropServices.Marshal.SizeOf(thd));
帮忙看下有什么错吗?为什么老不成功?
------解决方案--------------------把你所有的代码贴出来看看
------解决方案--------------------做录音?
用vc封个dll在调用吧..