diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-02-22 22:31:42 +0100 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-02-22 22:34:37 +0100 |
commit | 1a4a934d5eee53d16c86014e99c2f98914b13ebf (patch) | |
tree | 852b4765877db07975cd79af3ebd42dccbe28ae9 /rbutil | |
parent | d8fd988cf2f18d900accecc5f07f12ec71c48e73 (diff) |
Don't poll SAPI script output.
Wait for the process to signal new data available instead of polling its
output. Fixes synchronisation issues with sapi_voice.vbs that were causing
FS#12595.
Change-Id: I86e844e837ed20f32005fdccf7ec9e8c1efbe983
Diffstat (limited to 'rbutil')
-rw-r--r-- | rbutil/rbutilqt/base/ttssapi.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/rbutil/rbutilqt/base/ttssapi.cpp b/rbutil/rbutilqt/base/ttssapi.cpp index e2587b715f..00c63550d3 100644 --- a/rbutil/rbutilqt/base/ttssapi.cpp +++ b/rbutil/rbutilqt/base/ttssapi.cpp @@ -227,11 +227,8 @@ TTSStatus TTSSapi::voice(QString text,QString wavfile, QString *errStr) *voicestream << query; *voicestream << "SYNC\tbla\r\n"; voicestream->flush(); - char temp[20]; - - //we use this, because waitForReadyRead doesnt work from a different thread - while( voicescript->readLine(temp,20) == 0) - QCoreApplication::processEvents(); + // do NOT poll the output with readLine(), this causes sync issues! + voicescript->waitForReadyRead(); if(!QFileInfo(wavfile).isFile()) { qDebug() << "[TTSSapi] output file does not exist:" << wavfile; |