diff options
author | wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com> | 2019-05-30 10:01:18 +0800 |
---|---|---|
committer | wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com> | 2019-05-30 10:01:18 +0800 |
commit | c8d0de473418fb0312876e22a18f0fbda54c4b38 (patch) | |
tree | 1e969c50798ef7d2c87978f869ddae708138ed3f /app/guidance_module.h | |
parent | ae47635e56c4af4d816a76e5186e945768543679 (diff) |
update als2019 navigationsandbox/wangzhiqiang/als2019
Diffstat (limited to 'app/guidance_module.h')
-rw-r--r-- | app/guidance_module.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/app/guidance_module.h b/app/guidance_module.h new file mode 100644 index 0000000..69b3d85 --- /dev/null +++ b/app/guidance_module.h @@ -0,0 +1,35 @@ +#ifndef GUIDANCE_MODULE_H +#define GUIDANCE_MODULE_H +#include <sys/stat.h> +#include <QObject> +#include <QString> +#include <QDebug> + +#define SYS_LANGUAGE_INIT 0 +#define SYS_LANGUAGE_JP 1 +#define SYS_LANGUAGE_EN 2 +#define TTSMAX (2048) + +class Guidance_Module : public QObject +{ + Q_OBJECT +public: + int g_voicelanguage = SYS_LANGUAGE_INIT; + QString g_voice_module = ""; + Q_INVOKABLE void guidance(const QString &text){ + char tts_voice[TTSMAX]; + int len = 0; + memset(tts_voice,0,TTSMAX); + + strncat(tts_voice, "sh flite '", (TTSMAX - len - 1)); + + len = strlen(tts_voice); + strncat(tts_voice, text.toUtf8().data(), (TTSMAX - len - 1)); + + len = strlen(tts_voice); + strncat(tts_voice, "'&", (TTSMAX - len - 1)); + + system(tts_voice); + } +}; +#endif // GUIDANCE_MODULE_H |