diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-01-17 20:18:47 +0100 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-01-17 20:19:59 +0100 |
commit | 633749ea61585940f8a003aab9c9db9afb96a030 (patch) | |
tree | 6435614861d6969657125f729c94b7823a431e24 /rbutil | |
parent | 6e11289cc2478c2d7414399cb8a3b9ed1ce7a6c9 (diff) |
TTS: check if created wav file exists.
Instead of simply assuming the wav file that is supposed to be created by the
TTS engine check if the file actually exists and return an error if not.
Change-Id: I9e4a85a061b44b48931614602683b1dfe7dfce67
Diffstat (limited to 'rbutil')
-rw-r--r-- | rbutil/rbutilqt/base/ttsexes.cpp | 7 | ||||
-rw-r--r-- | rbutil/rbutilqt/base/ttssapi.cpp | 4 |
2 files changed, 10 insertions, 1 deletions
diff --git a/rbutil/rbutilqt/base/ttsexes.cpp b/rbutil/rbutilqt/base/ttsexes.cpp index 6766af4bb6..5e06b950bd 100644 --- a/rbutil/rbutilqt/base/ttsexes.cpp +++ b/rbutil/rbutilqt/base/ttsexes.cpp @@ -83,8 +83,13 @@ TTSStatus TTSExes::voice(QString text,QString wavfile, QString *errStr) execstring.replace("%options",m_TTSOpts); execstring.replace("%wavfile",wavfile); execstring.replace("%text",text); - //qDebug() << "voicing" << execstring; + QProcess::execute(execstring); + + if(!QFileInfo(wavfile).isFile()) { + qDebug() << "[TTSExes] output file does not exist:" << wavfile; + return FatalError; + } return NoError; } diff --git a/rbutil/rbutilqt/base/ttssapi.cpp b/rbutil/rbutilqt/base/ttssapi.cpp index b5e6a69624..4ca82a798b 100644 --- a/rbutil/rbutilqt/base/ttssapi.cpp +++ b/rbutil/rbutilqt/base/ttssapi.cpp @@ -233,6 +233,10 @@ TTSStatus TTSSapi::voice(QString text,QString wavfile, QString *errStr) while( voicescript->readLine(temp,20) == 0) QCoreApplication::processEvents(); + if(!QFileInfo(wavfile).isFile()) { + qDebug() << "[TTSExes] output file does not exist:" << wavfile; + return FatalError; + } return NoError; } |