summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/talkfile.cpp
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2007-12-15 13:13:57 +0000
committerDominik Wenger <domonoky@googlemail.com>2007-12-15 13:13:57 +0000
commitbebddd42c265bf63845f42bb29f48de5ed263f69 (patch)
treeb5dbb6e711d4d71034c4ee19ddfa7e0af043971b /rbutil/rbutilqt/talkfile.cpp
parent1e489e53b8d0807fc52423ae7453d4b1d047d370 (diff)
downloadrockbox-bebddd42c265bf63845f42bb29f48de5ed263f69.tar.gz
rockbox-bebddd42c265bf63845f42bb29f48de5ed263f69.tar.bz2
rockbox-bebddd42c265bf63845f42bb29f48de5ed263f69.zip
rbutil: reworked configuration of TTS engines to the new Style.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15932 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/talkfile.cpp')
-rw-r--r--rbutil/rbutilqt/talkfile.cpp77
1 files changed, 3 insertions, 74 deletions
diff --git a/rbutil/rbutilqt/talkfile.cpp b/rbutil/rbutilqt/talkfile.cpp
index 141af0b5ec..6f70111aff 100644
--- a/rbutil/rbutilqt/talkfile.cpp
+++ b/rbutil/rbutilqt/talkfile.cpp
@@ -30,15 +30,9 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
m_logger = logger;
m_logger->addItem("Starting Talk file generation",LOGINFO);
- if(m_curTTS == "sapi")
- m_tts = new TTSSapi();
- else
- m_tts = new TTSExes();
-
- m_tts->setTTSexe(m_TTSexec);
- m_tts->setTTsOpts(m_TTSOpts);
- m_tts->setTTsLanguage(m_TTSLanguage);
- m_tts->setTTsTemplate(m_curTTSTemplate);
+ //tts
+ m_tts = getTTS(userSettings->value("tts").toString());
+ m_tts->setUserCfg(userSettings);
if(!m_tts->start())
{
@@ -183,68 +177,3 @@ void TalkFileCreator::abort()
m_abort = true;
}
-bool TTSSapi::start()
-{
- QFileInfo tts(m_TTSexec);
- if(!tts.exists())
- return false;
-
- // create the voice process
- QString execstring = m_TTSTemplate;
- execstring.replace("%exe",m_TTSexec);
- execstring.replace("%options",m_TTSOpts);
- execstring.replace("%lang",m_TTSLanguage);
- qDebug() << "init" << execstring;
- voicescript = new QProcess(NULL);
- voicescript->start(execstring);
- if(!voicescript->waitForStarted())
- return false;
- return true;
-}
-
-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");
- voicescript->waitForReadyRead();
- return true;
-}
-
-bool TTSSapi::stop()
-{
- QString query = "QUIT\r\n";
- voicescript->write(query.toLocal8Bit());
- voicescript->waitForFinished();
- delete voicescript;
- return true;
-}
-
-bool TTSExes::start()
-{
- QFileInfo tts(m_TTSexec);
- qDebug() << "ttsexe init";
- if(tts.exists())
- {
- return true;
- }
- else
- {
- return false;
- }
-}
-
-bool TTSExes::voice(QString text,QString wavfile)
-{
- QString execstring = m_TTSTemplate;
-
- execstring.replace("%exe",m_TTSexec);
- execstring.replace("%options",m_TTSOpts);
- execstring.replace("%wavfile",wavfile);
- execstring.replace("%text",text);
- //qDebug() << "voicing" << execstring;
- QProcess::execute(execstring);
- return true;
-
-}