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.
This commit is contained in:
parent
7f26a10d31
commit
9db5c124af
2 changed files with 11 additions and 4 deletions
|
@ -145,7 +145,8 @@ TalkGenerator::Status TalkGenerator::voiceList(QList<TalkEntry>* list,int wavtri
|
||||||
|
|
||||||
// voice entry
|
// voice entry
|
||||||
QString error;
|
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);
|
TTSStatus status = m_tts->voice(list->at(i).toSpeak,list->at(i).wavfilename, &error);
|
||||||
if(status == Warning)
|
if(status == Warning)
|
||||||
{
|
{
|
||||||
|
@ -162,11 +163,17 @@ TalkGenerator::Status TalkGenerator::voiceList(QList<TalkEntry>* list,int wavtri
|
||||||
else
|
else
|
||||||
(*list)[i].voiced = true;
|
(*list)[i].voiced = true;
|
||||||
|
|
||||||
//wavetrim if needed
|
// wavtrim if needed
|
||||||
if(wavtrimth != -1)
|
if(wavtrimth != -1)
|
||||||
{
|
{
|
||||||
char buffer[255];
|
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);
|
emit logProgress(++m_progress,progressMax);
|
||||||
|
|
|
@ -187,7 +187,7 @@ void VoiceFileCreator::downloadDone(bool error)
|
||||||
connect(&generator,SIGNAL(logProgress(int,int)),this,SIGNAL(logProgress(int,int)));
|
connect(&generator,SIGNAL(logProgress(int,int)),this,SIGNAL(logProgress(int,int)));
|
||||||
connect(this,SIGNAL(aborted()),&generator,SLOT(abort()));
|
connect(this,SIGNAL(aborted()),&generator,SLOT(abort()));
|
||||||
|
|
||||||
if(generator.process(&m_talkList) == TalkGenerator::eERROR)
|
if(generator.process(&m_talkList, m_wavtrimThreshold) == TalkGenerator::eERROR)
|
||||||
{
|
{
|
||||||
cleanup();
|
cleanup();
|
||||||
emit logProgress(0,1);
|
emit logProgress(0,1);
|
||||||
|
|
Loading…
Reference in a new issue