diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-01-15 12:24:54 +0100 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-01-15 12:30:03 +0100 |
commit | 9db5c124af8eb7b950b64f0942262f549e661d4a (patch) | |
tree | b0be84b5839594d1d4e9ca20b29e1e99a2793c9b /rbutil/rbutilqt/base/talkgenerator.cpp | |
parent | 7f26a10d31911c3468312563cd2667a96278944b (diff) | |
download | rockbox-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/base/talkgenerator.cpp')
-rw-r--r-- | rbutil/rbutilqt/base/talkgenerator.cpp | 13 |
1 files changed, 10 insertions, 3 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 | |||
145 | 145 | ||
146 | // voice entry | 146 | // voice entry |
147 | QString error; | 147 | QString error; |
148 | qDebug() << "[TalkGenerator] voicing: " << list->at(i).toSpeak << "to" << list->at(i).wavfilename; | 148 | qDebug() << "[TalkGenerator] voicing: " << list->at(i).toSpeak |
149 | << "to" << list->at(i).wavfilename; | ||
149 | TTSStatus status = m_tts->voice(list->at(i).toSpeak,list->at(i).wavfilename, &error); | 150 | TTSStatus status = m_tts->voice(list->at(i).toSpeak,list->at(i).wavfilename, &error); |
150 | if(status == Warning) | 151 | if(status == Warning) |
151 | { | 152 | { |
@@ -162,11 +163,17 @@ TalkGenerator::Status TalkGenerator::voiceList(QList<TalkEntry>* list,int wavtri | |||
162 | else | 163 | else |
163 | (*list)[i].voiced = true; | 164 | (*list)[i].voiced = true; |
164 | 165 | ||
165 | //wavetrim if needed | 166 | // wavtrim if needed |
166 | if(wavtrimth != -1) | 167 | if(wavtrimth != -1) |
167 | { | 168 | { |
168 | char buffer[255]; | 169 | char buffer[255]; |
169 | wavtrim(list->at(i).wavfilename.toLocal8Bit().data(),wavtrimth,buffer,255); | 170 | if(wavtrim(list->at(i).wavfilename.toLocal8Bit().data(), |
171 | wavtrimth, buffer, 255)) | ||
172 | { | ||
173 | qDebug() << "[TalkGenerator] wavtrim returned error on" | ||
174 | << list->at(i).wavfilename; | ||
175 | return eERROR; | ||
176 | } | ||
170 | } | 177 | } |
171 | 178 | ||
172 | emit logProgress(++m_progress,progressMax); | 179 | emit logProgress(++m_progress,progressMax); |