1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Dominik Riebeling 2011-10-01 19:48:58 +00:00
parent 7f2defc453
commit 4f56b50df4
10 changed files with 119 additions and 8 deletions

View file

@ -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)));