summaryrefslogtreecommitdiffstats
path: root/rbutil
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2008-09-27 00:05:54 +0000
committerDominik Wenger <domonoky@googlemail.com>2008-09-27 00:05:54 +0000
commit6a012210d0e35cc1fced18e49de5dbb6be36d81d (patch)
tree48b1e440ad1960552087c27ab50bb30b77f11657 /rbutil
parent1ab86bb370f9c20cbe38aee2e7a6f6bfee1e287e (diff)
downloadrockbox-6a012210d0e35cc1fced18e49de5dbb6be36d81d.tar.gz
rockbox-6a012210d0e35cc1fced18e49de5dbb6be36d81d.zip
rbutil: hopefully fix sapi voice engine support. (sapi_voice.vbs wants now utf16)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18654 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil')
-rw-r--r--rbutil/rbutilqt/tts.cpp18
-rw-r--r--rbutil/rbutilqt/tts.h2
2 files changed, 14 insertions, 6 deletions
diff --git a/rbutil/rbutilqt/tts.cpp b/rbutil/rbutilqt/tts.cpp
index c603e148f1..76eacd54ca 100644
--- a/rbutil/rbutilqt/tts.cpp
+++ b/rbutil/rbutilqt/tts.cpp
@@ -246,6 +246,10 @@ bool TTSSapi::start(QString *errStr)
if(*errStr != "")
return false;
}
+
+ voicestream = new QTextStream(voicescript);
+ voicestream->setCodec("UTF16-LE");
+
return true;
}
@@ -272,9 +276,10 @@ QStringList TTSSapi::getVoiceList(QString language)
qDebug() << "init" << execstring;
voicescript = new QProcess(NULL);
voicescript->start(execstring);
+ qDebug() << "wait for started";
if(!voicescript->waitForStarted())
return result;
-
+ voicescript->closeWriteChannel();
voicescript->waitForReadyRead();
QString dataRaw = voicescript->readAllStandardError().data();
@@ -303,17 +308,20 @@ bool TTSSapi::voice(QString text,QString wavfile)
{
QString query = "SPEAK\t"+wavfile+"\t"+text+"\r\n";
qDebug() << "voicing" << query;
- voicescript->write(query.toLocal8Bit());
- voicescript->write("SYNC\tbla\r\n");
+ *voicestream << query;
+ *voicestream << "SYNC\tbla\r\n";
+ voicestream->flush();
voicescript->waitForReadyRead();
return true;
}
bool TTSSapi::stop()
{
- QString query = "QUIT\r\n";
- voicescript->write(query.toLocal8Bit());
+
+ *voicestream << "QUIT\r\n";
+ voicestream->flush();
voicescript->waitForFinished();
+ delete voicestream;
delete voicescript;
QFile::setPermissions(QDir::tempPath() +"/sapi_voice.vbs",QFile::ReadOwner |QFile::WriteOwner|QFile::ExeOwner
|QFile::ReadUser| QFile::WriteUser| QFile::ExeUser
diff --git a/rbutil/rbutilqt/tts.h b/rbutil/rbutilqt/tts.h
index f73114b8c1..7c21fd0d65 100644
--- a/rbutil/rbutilqt/tts.h
+++ b/rbutil/rbutilqt/tts.h
@@ -81,7 +81,7 @@ class TTSSapi : public TTSBase
QStringList getVoiceList(QString language);
private:
QProcess* voicescript;
-
+ QTextStream* voicestream;
QString defaultLanguage;
QString m_TTSexec;