speechthread.h 429 B

123456789101112131415161718192021222324252627
  1. #ifndef SPEECHTHREAD_H
  2. #define SPEECHTHREAD_H
  3. #include <QObject>
  4. #include <QTextToSpeech>
  5. #include <QTimer>
  6. class SpeechThread : public QObject
  7. {
  8. Q_OBJECT
  9. public:
  10. explicit SpeechThread(QObject *parent = nullptr);
  11. void append(QString speech);
  12. void start();
  13. signals:
  14. public slots:
  15. void timeout();
  16. private:
  17. QStringList SpeechList;
  18. QTextToSpeech *tts;
  19. QTimer *timer;
  20. };
  21. #endif // SPEECHTHREAD_H