Commit 9e8b67d1 authored by jwendt's avatar jwendt
Browse files

added scaling to avoid clipping during resampling

parent 0031c478
......@@ -82,7 +82,7 @@ const float* CVATextToSpeechSignalSource::GetStreamBlock( const CVAAudiostreamSt
delete m_pFrameToDelete;
m_pFrameToDelete = NULL;
}
VA_INFO("CVATextToSpeechSignalSource", "TTS to VA_PLAYBACK_ACTION_STOP");
//VA_INFO("CVATextToSpeechSignalSource", "TTS to VA_PLAYBACK_ACTION_STOP");
}
}
......@@ -267,6 +267,7 @@ void CVATextToSpeechSignalSource::SetParameters( const CVAStruct& oParams )
ITASampleFrame* pAudioBuffer = new ITASampleFrame();
pAudioBuffer->init(1, data.floatBuffer.size(), false);
(*pAudioBuffer)[0].write(&data.floatBuffer[0], data.floatBuffer.size());
pAudioBuffer->mul_scalar(0.95); //this way clipping is avoided
CITAAudioSample* pAudioSample = new CITAAudioSample();
pAudioSample->Load(*pAudioBuffer, TTSEngine::getInstance().getSampleRate());
......@@ -321,7 +322,7 @@ void CVATextToSpeechSignalSource::SetParameters( const CVAStruct& oParams )
ITASampleFrame* pAudioBuffer = it->second;
VA_INFO("CVATextToSpeechSignalSource", "GetSAmpleRAte: " + std::to_string(GetSampleRate()) + " engine::rate " + std::to_string(TTSEngine::getInstance().getSampleRate()));
if (m_pBufferDataSource != NULL)
delete m_pBufferDataSource;
......@@ -338,6 +339,7 @@ void CVATextToSpeechSignalSource::SetParameters( const CVAStruct& oParams )
m_Visemes[id] = "";
}
VA_INFO("CVATextToSpeechSignalSource", "Play TTS for id: \"" + id + "\"");
return;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment