⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lcywavein.h

📁 对PC声卡进行操作
💻 H
字号:
/*声卡音频实时函数库的应用程序接口头文件*/
#ifndef PORT_AUDIO_H
#define PORT_AUDIO_H

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
int frameIndex;
//#define LCYInt16        ((unsigned long) (1<<1))
/*1.回调函数及参数说明:
 inputBuffer :输入缓冲区指针。
 framesPerBuffer:每次采样数据帧数。
*/
typedef int (PortAudioCallback)(
                void *inputBuffer, 
                unsigned long framesPerBuffer);
/*2.打开声卡输入端函数及参数说明:
 nputDevice:设置声卡号,用第1个声卡时,为1;用第2个声卡时,为2。
 numInputChannels:设置声道数,1时,单声道;2时,双声道。
 sampleRate:设置采样频率,1KHz至200KHz。
 framesPerBuffer:每次采样的数据数。
 callback:回调函数指针。*/
int LCY_OpenSoundCardIn(
                       int inputDevice,
                       int numInputChannels,
                       double sampleRate,
                       unsigned long framesPerBuffer,
                       PortAudioCallback *callback);
/*3.关闭声卡输入端函数*/
int LCY_CloseSoundCardIn(void);
/*4.开始采集输入端数据函数*/
int LCY_StartInStream( void);    
int StartRecord(void){
	frameIndex=0;
	return LCY_StartInStream();
}    
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* PORT_AUDIO_H */
#include <math.h>
const float PI=2*asinf(1.0);
long neg_i1 = -1;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -