-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrecorder.h
47 lines (37 loc) · 858 Bytes
/
recorder.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef RECORDER_H
#define RECORDER_H
#include <QObject>
#include <QAudioDeviceInfo>
#include <QAudioInput>
class SpeechDetector;
class QAudioFormat;
class Recorder : public QObject
{
Q_OBJECT
public:
explicit Recorder(QAudioFormat * format, QObject *parent = 0);
void record(QString word);
int getMaxVolume();
signals:
void volume(int volume);
void active(bool);
void stored(QString);
public slots:
void update();
void stopRecord();
void needToStop();
void stopTest();
void startTest();
void setFactor(double);
void setFrameSize(int);
void setStepSize(int);
void setBufferSize(int);
private:
QAudioFormat * format;
QAudioDeviceInfo device;
QAudioInput * inputAudio;
SpeechDetector * detector;
QString word;
void storeBuffer();
};
#endif // RECORDER_H