代码拉取完成,页面将自动刷新
#ifndef RECORDTHREAD_H
#define RECORDTHREAD_H
#include <QWidget>
#include <QThread>
#include <RtAudio.h>
#include <vector>
class RecordThread : public QThread
{
Q_OBJECT
public:
enum Types
{
TOMCAT = 0,
MINIONS,
NONE,
};
enum PlayTypes
{
RECORD = 0,
REALTIME,
};
signals:
void recordOver(void);
void recordPlayOver(void);
public:
std::vector<short> m_RecordData;
bool m_isplay;
int m_recordPlayIndex;
bool m_RecordEnable;
public:
explicit RecordThread(QWidget *parent = NULL);
static int record(void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, double streamTime, RtAudioStreamStatus status, void *userData);
void stop();
static void pitchShift(short *input, short *output, int totalsize, int sampleRate, Types type, float PitchShift);
Types GetType(){return m_type;}
void setType(Types type) {m_type = type;}
float GetPitchShift(){return m_pitchShift;}
void setPitchShift(float pitchshift){m_pitchShift = pitchshift;}
PlayTypes GetPlayType(){return m_playType;}
void setPlayType(PlayTypes type){m_playType = type;}
void recordEnable();
void recordEnablePlay();
protected:
virtual void run();
private:
RtAudio adc;
RtAudio::StreamParameters input;
RtAudio::StreamParameters output;
Types m_type;
PlayTypes m_playType;
float m_pitchShift;
};
#endif // RECORDTHREAD_H
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。