GUI: U32: Enable u32 for tts (Linux)

This commit is contained in:
aryanrawlani28 2020-06-18 00:07:12 +05:30 committed by Eugene Sandulenko
parent ef7ec444d3
commit bcbe2fe2ea
2 changed files with 6 additions and 3 deletions

View File

@ -177,7 +177,7 @@ void SpeechDispatcherManager::updateState(SpeechDispatcherManager::SpeechEvent e
}
}
bool SpeechDispatcherManager::say(Common::String str, Action action, Common::String charset) {
bool SpeechDispatcherManager::say(const Common::U32String &str, Action action, Common::String charset) {
pthread_mutex_lock(&_speechMutex);
// reinitialize if needed
@ -202,7 +202,9 @@ bool SpeechDispatcherManager::say(Common::String str, Action action, Common::Str
#endif
}
char *tmpStr = Common::Encoding::convert("UTF-8", charset, str.c_str(), str.size());
Common::String strToSpeak = str.encode();
char *tmpStr = Common::Encoding::convert("UTF-8", charset, strToSpeak.c_str(), strToSpeak.size());
if (tmpStr == nullptr) {
warning("Cannot convert from %s encoding for text to speech", charset.c_str());
pthread_mutex_unlock(&_speechMutex);

View File

@ -29,6 +29,7 @@
#include "common/text-to-speech.h"
#include "common/str.h"
#include "common/ustr.h"
#include "common/list.h"
#include "common/mutex.h"
@ -59,7 +60,7 @@ public:
SpeechDispatcherManager();
virtual ~SpeechDispatcherManager() override;
virtual bool say(Common::String str, Action action, Common::String charset = "") override;
virtual bool say(const Common::U32String &str, Action action, Common::String charset = "") override;
virtual bool stop() override;
virtual bool pause() override;