1 Star 0 Fork 0

惟江上之青枫/audioChange

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
recordthread.h 1.43 KB
一键复制 编辑 原始数据 按行查看 历史
zcx 提交于 2022-02-16 10:35 . first
#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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/zcxqf/audio-change.git
git@gitee.com:zcxqf/audio-change.git
zcxqf
audio-change
audioChange
master

搜索帮助