diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2011-10-01 19:48:58 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2011-10-01 19:48:58 +0000 |
commit | 4f56b50df45cf81370c3a29bd443b91cf5fca1b0 (patch) | |
tree | 92b105d056a47401949c9db6b5529570a63cb3f9 /rbutil/rbutilqt/base/voicefile.cpp | |
parent | 7f2defc453045e037cccf50456753d310c7d7e88 (diff) | |
download | rockbox-4f56b50df45cf81370c3a29bd443b91cf5fca1b0.tar.gz rockbox-4f56b50df45cf81370c3a29bd443b91cf5fca1b0.zip |
Voicefile generation: implement string corrections.
Voicefile generation now can correct strings for the TTS system similar
to what voice.pl does. The current implementation has some limitations:
- only implemented for voicefile creation.
- the corrections file is built in and can't get changed.
- string corrections can be disabled in the configuration dialog.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30628 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/base/voicefile.cpp')
-rw-r--r-- | rbutil/rbutilqt/base/voicefile.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/rbutil/rbutilqt/base/voicefile.cpp b/rbutil/rbutilqt/base/voicefile.cpp index ce4596828f..04825f6d91 100644 --- a/rbutil/rbutilqt/base/voicefile.cpp +++ b/rbutil/rbutilqt/base/voicefile.cpp | |||
@@ -132,6 +132,7 @@ void VoiceFileCreator::downloadDone(bool error) | |||
132 | QString id, voice; | 132 | QString id, voice; |
133 | bool idfound = false; | 133 | bool idfound = false; |
134 | bool voicefound=false; | 134 | bool voicefound=false; |
135 | bool useCorrection = RbSettings::value(RbSettings::UseTtsCorrections).toBool(); | ||
135 | while (!in.atEnd()) | 136 | while (!in.atEnd()) |
136 | { | 137 | { |
137 | QString line = in.readLine(); | 138 | QString line = in.readLine(); |
@@ -151,7 +152,8 @@ void VoiceFileCreator::downloadDone(bool error) | |||
151 | TalkGenerator::TalkEntry entry; | 152 | TalkGenerator::TalkEntry entry; |
152 | entry.toSpeak = voice; | 153 | entry.toSpeak = voice; |
153 | entry.wavfilename = m_path + "/" + id + ".wav"; | 154 | entry.wavfilename = m_path + "/" + id + ".wav"; |
154 | entry.talkfilename = m_path + "/" + id + ".mp3"; //voicefont wants them with .mp3 extension | 155 | //voicefont wants them with .mp3 extension |
156 | entry.talkfilename = m_path + "/" + id + ".mp3"; | ||
155 | entry.voiced = false; | 157 | entry.voiced = false; |
156 | entry.encoded = false; | 158 | entry.encoded = false; |
157 | if(id == "VOICE_PAUSE") | 159 | if(id == "VOICE_PAUSE") |
@@ -178,6 +180,9 @@ void VoiceFileCreator::downloadDone(bool error) | |||
178 | // generate files | 180 | // generate files |
179 | { | 181 | { |
180 | TalkGenerator generator(this); | 182 | TalkGenerator generator(this); |
183 | // set language for string correction. If not set no correction will be made. | ||
184 | if(useCorrection) | ||
185 | generator.setLang(m_lang); | ||
181 | connect(&generator,SIGNAL(done(bool)),this,SIGNAL(done(bool))); | 186 | connect(&generator,SIGNAL(done(bool)),this,SIGNAL(done(bool))); |
182 | connect(&generator,SIGNAL(logItem(QString,int)),this,SIGNAL(logItem(QString,int))); | 187 | connect(&generator,SIGNAL(logItem(QString,int)),this,SIGNAL(logItem(QString,int))); |
183 | connect(&generator,SIGNAL(logProgress(int,int)),this,SIGNAL(logProgress(int,int))); | 188 | connect(&generator,SIGNAL(logProgress(int,int)),this,SIGNAL(logProgress(int,int))); |