File indexing completed on 2025-03-16 05:18:26

0001 #ifndef AUDIOREC_H
0002 #define AUDIOREC_H
0003 
0004 #include <QObject>
0005 #include <QFile>
0006 #include <QtWebSockets>
0007 #include "mycroftcontroller.h"
0008 #include "controllerconfig.h"
0009 
0010 #include <QAudioSource>
0011 
0012 class AudioRec : public QObject
0013 {
0014     Q_OBJECT
0015 public:
0016     explicit AudioRec(QObject *parent = nullptr);
0017 
0018 public Q_SLOTS:
0019     void recordTStart();
0020     void recordTStop();
0021     void readStream();
0022     void returnStream();
0023     void captureDataFromDevice();
0024 
0025 Q_SIGNALS:
0026     void recordTStatus(const QString &recStatus);
0027     void micAudioLevelChanged(const qreal &micLevel);
0028 
0029 private:
0030     MycroftController *m_controller;
0031     QFile destinationFile;
0032     QByteArray m_audStream;
0033     qint16 m_audStream_size;
0034     QAudioSource *audio;
0035     QIODevice *device;
0036 };
0037 
0038 #endif // AUDIOREC_H