#ifndef ETVOICETEST_H
#define ETVOICETEST_H

#include <QWidget>
#include <QTimer>
#include "CHttpBll.h"

namespace Ui {
class etVoiceTest;
}

class etVoiceTest : public QWidget
{
    Q_OBJECT

public:
    explicit etVoiceTest(QWidget *parent = nullptr);
    ~etVoiceTest();

    int setUI(const int nLeft, const int nTop, const int nWidth);
    int widgetHeight();
    int getCheckStatus();//0:false 1:true 2:未检测
private slots:
	void onDownLoadFile(CDownLoadFileInfo downLoadFileInfo);
    void on_btn_etvt_canotPlay_clicked();

    void on_btn_etvt_canPlay_clicked();

    void on_btn_etvt_play_clicked();

    void on_btn_etvt_download_clicked();

    void on_hslider_etvt_volume_valueChanged(int value);

    void on_btn_etvt_volume_clicked();

private:
	void initAudioDuration();

    Ui::etVoiceTest *ui;

	const QString sAudioUrl = "https://ecs-static.qmth.com.cn/check-audio.mp3";
	int m_nPlayVol;
    int m_nLastVol = 0;
	QString m_sDownLoadAudioFile;

	std::shared_ptr<QTimer> m_pTimer;
	int m_nAudioSecord;
	std::string m_sRecordDevice;

    int m_nVoiceStatus;    
    bool m_bMute = false;
};

#endif // ETVOICETEST_H
