#ifndef SPEAKERUTIL_H #define SPEAKERUTIL_H #include <QObject> #include <QTextToSpeech> #include <QSoundEffect> class SpeakerUtil : public QObject { Q_OBJECT public: ~SpeakerUtil() {} SpeakerUtil(const SpeakerUtil&)=delete; SpeakerUtil& operator=(const SpeakerUtil&)=delete; static SpeakerUtil& getInstance() { static SpeakerUtil instance; return instance; } void speak(QString content); void sayIdentifySuccessZhCn(); void sayIdentifyFailureZhCn(); private: explicit SpeakerUtil(QObject *parent = nullptr); QTextToSpeech * tts; QSoundEffect effect; signals: }; #endif // SPEAKERUTIL_H