From e2f5a8c3fea98d5a1af7290235dd05f5b8acaa96 Mon Sep 17 00:00:00 2001 From: Thomas Gubler Date: Mon, 16 Jun 2014 15:51:22 +0200 Subject: [PATCH] espeak: provide string length with 0 character, fixes problems with qgc reading out strange values/chars at the end of the sentence --- src/GAudioOutput.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/GAudioOutput.cc b/src/GAudioOutput.cc index ff88dfe94..35aef2ff7 100644 --- a/src/GAudioOutput.cc +++ b/src/GAudioOutput.cc @@ -212,7 +212,8 @@ bool GAudioOutput::say(QString text, int severity) #endif // _MSC_VER #if defined Q_OS_LINUX - unsigned int espeak_size = strlen(text.toStdString().c_str()); + // Set size of string for espeak: +1 for the null-character + unsigned int espeak_size = strlen(text.toStdString().c_str()) + 1; espeak_Synth(text.toStdString().c_str(), espeak_size, 0, POS_CHARACTER, 0, espeakCHARS_AUTO, NULL, NULL); #endif // Q_OS_LINUX -- 2.22.0