etVoiceTest.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef ETVOICETEST_H
  2. #define ETVOICETEST_H
  3. #include <QWidget>
  4. #include <QTimer>
  5. #include "CHttpBll.h"
  6. namespace Ui {
  7. class etVoiceTest;
  8. }
  9. class etVoiceTest : public QWidget
  10. {
  11. Q_OBJECT
  12. public:
  13. explicit etVoiceTest(QWidget *parent = nullptr);
  14. ~etVoiceTest();
  15. int setUI(const int nLeft, const int nTop, const int nWidth);
  16. int widgetHeight();
  17. int getCheckStatus();//0:false 1:true 2:未检测
  18. private slots:
  19. void onDownLoadFile(CDownLoadFileInfo downLoadFileInfo);
  20. void on_btn_etvt_canotPlay_clicked();
  21. void on_btn_etvt_canPlay_clicked();
  22. void on_btn_etvt_play_clicked();
  23. void on_btn_etvt_download_clicked();
  24. void on_hslider_etvt_volume_valueChanged(int value);
  25. void on_btn_etvt_volume_clicked();
  26. private:
  27. void initAudioDuration();
  28. Ui::etVoiceTest *ui;
  29. const QString sAudioUrl = "https://ecs-static.qmth.com.cn/check-audio.mp3";
  30. int m_nPlayVol;
  31. int m_nLastVol = 0;
  32. QString m_sDownLoadAudioFile;
  33. std::shared_ptr<QTimer> m_pTimer;
  34. int m_nAudioSecord;
  35. std::string m_sRecordDevice;
  36. int m_nVoiceStatus;
  37. bool m_bMute = false;
  38. };
  39. #endif // ETVOICETEST_H