bool _stdcall In878Audio(int num,int Iflag, int auformat,HWND sendhwnd)//初始化音频输入
bool _stdcall apiSetAudioIn(int num,int PFlag,int fmt)//设置输入音频
bool _stdcall apiStarAudioIn(int num)//开始音频输入
3.5 WINIO.DLL函数在VB6.0调用
在VB6.0中开发程序,要调用WINIO.DLL中的函数, 函数的封装要符合VB6.0开发环境给定的规则, 才能顺利调用。
上述接口函数在(VB)主程序中调用,要在模块文件中封装如下:
Declare Function talk729decoderinit Lib "WinIo.dll" () As Boolean
Declare Function DecodeAudioData Lib "WinIo.dll" (ByVal lpin As Long, ByVal inlen As Long, ByVal lpout As Long, ByVal lpoutlen As Long) As Boolean
Declare Function sendhwndtlp Lib "WinIo.dll" (ByVal vbtexthwnd As Long, ByVal vblpmax As Long, ByVal vbstorekhwnd As Long, ByVal vblpalldata1 As Long, ByVal vblpalldata2 As Long, ByVal vblpcodedata As Long) As Boolean '
Declare Function In878Audio Lib "WinIo.dll" (ByVal apinum As Long, ByVal apipflag As Long, ByVal apiauformat As Long, ByVal apisendhwnd As Long) As Boolean
Declare Function SetAudioIn Lib "sd878AUD" (ByVal channum As Long, ByVal PanelFlag As Long, ByVal AudioFmt As Long) As Long
Declare Function StarAudioIn Lib "sd878AUD" (ByVal channum As Long) As Long
Declare Function SetAudioIn Lib "sd878AUD" (ByVal channum As Long, ByVal PanelFlag As Long, ByVal AudioFmt As Long) As Long
3.6 VB 中变量指针的使用
VB中变量的指针用函数VarPtr(VAR)计算,long类型,如下向DLL传送数组指针:
Dim ptr as long
Dim allwdata(500000) as byte ’定义字节数组
ptr = VarPtr(allwdata(0)) ’计算数组指针
sendhwndtlp(…,…, ptr,…)’向DLL 传送指针
4 结语
将C程序编辑、连接为动态链接库文件,即可在 VB程序中调用有关函数, 编译生成运行代码, 运行结果, 30路音频可同时不间断压缩回放,300GB硬盘可以1个半月循环存放, 回放话音清晰。
|