summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2012-01-15 12:24:54 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2012-01-15 12:30:03 +0100
commit9db5c124af8eb7b950b64f0942262f549e661d4a (patch)
treeb0be84b5839594d1d4e9ca20b29e1e99a2793c9b /rbutil/rbutilqt
parent7f26a10d31911c3468312563cd2667a96278944b (diff)
downloadrockbox-9db5c124af8eb7b950b64f0942262f549e661d4a.tar.gz
rockbox-9db5c124af8eb7b950b64f0942262f549e661d4a.zip
Fix wavtrim on voicefile creation.
Pass the threshold value for wavtrim to the TalkGenerator object instead of using the default value. Makes wavtrim to be actually used. Furthermore, check the result of the wavtrim call and respect its return value.
Diffstat (limited to 'rbutil/rbutilqt')
-rw-r--r--rbutil/rbutilqt/base/talkgenerator.cpp13
-rw-r--r--rbutil/rbutilqt/base/voicefile.cpp2
2 files changed, 11 insertions, 4 deletions
diff --git a/rbutil/rbutilqt/base/talkgenerator.cpp b/rbutil/rbutilqt/base/talkgenerator.cpp
index 6dc0cebc19..ecb39cad2f 100644
--- a/rbutil/rbutilqt/base/talkgenerator.cpp
+++ b/rbutil/rbutilqt/base/talkgenerator.cpp
@@ -145,7 +145,8 @@ TalkGenerator::Status TalkGenerator::voiceList(QList<TalkEntry>* list,int wavtri
// voice entry
QString error;
- qDebug() << "[TalkGenerator] voicing: " << list->at(i).toSpeak << "to" << list->at(i).wavfilename;
+ qDebug() << "[TalkGenerator] voicing: " << list->at(i).toSpeak
+ << "to" << list->at(i).wavfilename;
TTSStatus status = m_tts->voice(list->at(i).toSpeak,list->at(i).wavfilename, &error);
if(status == Warning)
{
@@ -162,11 +163,17 @@ TalkGenerator::Status TalkGenerator::voiceList(QList<TalkEntry>* list,int wavtri
else
(*list)[i].voiced = true;
- //wavetrim if needed
+ // wavtrim if needed
if(wavtrimth != -1)
{
char buffer[255];
- wavtrim(list->at(i).wavfilename.toLocal8Bit().data(),wavtrimth,buffer,255);
+ if(wavtrim(list->at(i).wavfilename.toLocal8Bit().data(),
+ wavtrimth, buffer, 255))
+ {
+ qDebug() << "[TalkGenerator] wavtrim returned error on"
+ << list->at(i).wavfilename;
+ return eERROR;
+ }
}
emit logProgress(++m_progress,progressMax);
diff --git a/rbutil/rbutilqt/base/voicefile.cpp b/rbutil/rbutilqt/base/voicefile.cpp
index ebabf9e8f6..2cc9f18c25 100644
--- a/rbutil/rbutilqt/base/voicefile.cpp
+++ b/rbutil/rbutilqt/base/voicefile.cpp
@@ -187,7 +187,7 @@ void VoiceFileCreator::downloadDone(bool error)
connect(&generator,SIGNAL(logProgress(int,int)),this,SIGNAL(logProgress(int,int)));
connect(this,SIGNAL(aborted()),&generator,SLOT(abort()));
- if(generator.process(&m_talkList) == TalkGenerator::eERROR)
+ if(generator.process(&m_talkList, m_wavtrimThreshold) == TalkGenerator::eERROR)
{
cleanup();
emit logProgress(0,1);