forked from len0rd/rockbox
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
This commit is contained in:
parent
d8fd988cf2
commit
1a4a934d5e
1 changed files with 2 additions and 5 deletions
|
@ -227,11 +227,8 @@ TTSStatus TTSSapi::voice(QString text,QString wavfile, QString *errStr)
|
||||||
*voicestream << query;
|
*voicestream << query;
|
||||||
*voicestream << "SYNC\tbla\r\n";
|
*voicestream << "SYNC\tbla\r\n";
|
||||||
voicestream->flush();
|
voicestream->flush();
|
||||||
char temp[20];
|
// do NOT poll the output with readLine(), this causes sync issues!
|
||||||
|
voicescript->waitForReadyRead();
|
||||||
//we use this, because waitForReadyRead doesnt work from a different thread
|
|
||||||
while( voicescript->readLine(temp,20) == 0)
|
|
||||||
QCoreApplication::processEvents();
|
|
||||||
|
|
||||||
if(!QFileInfo(wavfile).isFile()) {
|
if(!QFileInfo(wavfile).isFile()) {
|
||||||
qDebug() << "[TTSSapi] output file does not exist:" << wavfile;
|
qDebug() << "[TTSSapi] output file does not exist:" << wavfile;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue