Fixing problems with reverb time sizes, now 3 or 8 is accepted throughout the code

parent d3e88f27
......@@ -321,9 +321,6 @@ void CVABinauralArtificialReverbAudioRenderer::Init( const CVAStruct& oArgs )
m_vdReverberationTimes = StringToDoubleVec( sReverberationTimes );
if( !( m_vdReverberationTimes.size() == 3 || m_vdReverberationTimes.size() == 8 ) )
ITA_EXCEPT_INVALID_PARAMETER( "BinauralArtificialReverbAudioRenderer", "Please provide 3 or 8 reverberation time values" );
std::string sReverberationTime;
conf.OptString( "ReverberationTime", sReverberationTime );
......@@ -334,6 +331,11 @@ void CVABinauralArtificialReverbAudioRenderer::Init( const CVAStruct& oArgs )
m_vdReverberationTimes = { dReverberationTime * sqrt( 2 ), dReverberationTime, dReverberationTime / sqrt( 2 ) };
}
else
{
if( !( m_vdReverberationTimes.size() == 3 || m_vdReverberationTimes.size() == 8 ) )
ITA_EXCEPT_INVALID_PARAMETER( "BinauralArtificialReverbAudioRenderer", "ReverberationTimes: please provide 3 (low, mid high) or 8 octave band values from 63Hz to 8kHz" );
}
DesignEQFilters();
......@@ -403,7 +405,7 @@ void CVABinauralArtificialReverbAudioRenderer::DesignEQFilters()
m_vpFilter.push_back( std::make_shared< CBandPassFilter >( 2300.0f, 4000.0f, GetSampleRate() ) );
m_vpFilter.push_back( std::make_shared< CHighPassFilter >( 3900.0f, GetSampleRate() ) );
}
else if( m_vdReverberationTimes.size() == 10 )
else if( m_vdReverberationTimes.size() == 8 )
{
m_vpFilter.clear();
float fLowPassFrequencyCuttoff = OCTAVE_CENTER_FREQUENCIES_ISO_F[ 0 ] * sqrt( 2.0f );
......@@ -421,7 +423,7 @@ void CVABinauralArtificialReverbAudioRenderer::DesignEQFilters()
}
else
{
VA_ERROR( "BinauralArtificialReverbAudioRenderer", "Current implementation only accepts 3 reverb times for low, mid & high frequencies or octave resolution (8 values)" );
VA_ERROR( "BinauralArtificialReverbAudioRenderer", "Current implementation only accepts 3 reverb times for low, mid & high frequencies or octave resolution (8 values from 63Hz to 8kHz)" );
}
m_mxFilterDesign.release();
}
......@@ -756,7 +758,7 @@ void CVABinauralArtificialReverbAudioRenderer::SetParameters( const CVAStruct& o
else if( oReverbTimes.IsData() )
{
int iNumReverbTimes = int( oReverbTimes.GetDataSize() / sizeof( float ) );
if( iNumReverbTimes == 3 || iNumReverbTimes == 10 )
if( iNumReverbTimes == 3 || iNumReverbTimes == 8 )
{
m_vdReverberationTimes.resize( iNumReverbTimes );
const auto pfReverbTimes = ( const float* ) oReverbTimes.GetData();
......
Markdown is supported
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