From 4f56b50df45cf81370c3a29bd443b91cf5fca1b0 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Sat, 1 Oct 2011 19:48:58 +0000 Subject: 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 --- rbutil/rbutilqt/base/voicefile.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'rbutil/rbutilqt/base/voicefile.cpp') 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) QString id, voice; bool idfound = false; bool voicefound=false; + bool useCorrection = RbSettings::value(RbSettings::UseTtsCorrections).toBool(); while (!in.atEnd()) { QString line = in.readLine(); @@ -151,7 +152,8 @@ void VoiceFileCreator::downloadDone(bool error) TalkGenerator::TalkEntry entry; entry.toSpeak = voice; entry.wavfilename = m_path + "/" + id + ".wav"; - entry.talkfilename = m_path + "/" + id + ".mp3"; //voicefont wants them with .mp3 extension + //voicefont wants them with .mp3 extension + entry.talkfilename = m_path + "/" + id + ".mp3"; entry.voiced = false; entry.encoded = false; if(id == "VOICE_PAUSE") @@ -178,6 +180,9 @@ void VoiceFileCreator::downloadDone(bool error) // generate files { TalkGenerator generator(this); + // set language for string correction. If not set no correction will be made. + if(useCorrection) + generator.setLang(m_lang); connect(&generator,SIGNAL(done(bool)),this,SIGNAL(done(bool))); connect(&generator,SIGNAL(logItem(QString,int)),this,SIGNAL(logItem(QString,int))); connect(&generator,SIGNAL(logProgress(int,int)),this,SIGNAL(logProgress(int,int))); -- cgit v1.2.3