源码: pro文件加载库文件 INCLUDEPATH += C:\work\test\test_audio_record_16k\libspeex1\include LIBS += -LC:\work\test\test_audio_record_16k\libspeex1 -llibspeex
audio_read.h
#ifndef AUDIO_READ_H
#define AUDIO_READ_H
#include "world.h"
class Audio_Read : public QObject
{
Q_OBJECT
public:
Audio_Read();
signals:
/*********************************************************************
* 发送网络帧
*参数:frame:发送的报文
**********************************************************************/
void sig_net_tx_frame(QByteArray frame);
public slots:
void readMore();
private:
QAudioInput* audio_in; // class member.
QIODevice *myBuffer_in;
//SPEEX相关全局变量
SpeexBits bits_enc;
void *Enc_State;
short input_frame[SPEEX_FRAME_BYTE / 2]; //speex压缩输入存储区
short input_frame0[SPEEX_FRAME_BYTE / 2]; //speex压缩输入存储区
char cbits[SPEEX_FRAME_BYTE]; //压缩后数据存储区
char buf[SPEEX_FRAME_BYTE]; //读取声卡存储区
};
#endif // AUDIO_READ_H
|