Commit 54a72bd5 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Adding warning and exception for HRIR num channel validation

parent e306f3c2
......@@ -48,6 +48,7 @@ CVADirectivityDAFFHRIR::CVADirectivityDAFFHRIR( const std::string& sFilename, co
}
m_pContent = dynamic_cast< DAFFContentIR* >( m_pReader->getContent() );
assert( m_pContent );
if( m_pContent->getSamplerate() != dDesiredSamplerate )
{
......@@ -66,7 +67,7 @@ CVADirectivityDAFFHRIR::CVADirectivityDAFFHRIR( const std::string& sFilename, co
m_fLatency = 0.0f;
// Filter-Latenz
// Latency compensation
if( !m_pMetadata->hasKey( "DELAY_SAMPLES" ) )
{
VA_WARN( "DirectivityDAFFIR", std::string( "The file \"" ) + sFilename + std::string( "\" is missing the meta tag DELAY_SAMPLES." ) );
......@@ -90,11 +91,15 @@ CVADirectivityDAFFHRIR::CVADirectivityDAFFHRIR( const std::string& sFilename, co
m_iMinOffset = m_pContent->getMinEffectiveFilterOffset();
m_iFilterLength = m_pContent->getFilterLength();
// Warnung, falls keine Vollkugel
if( !m_pReader->getProperties()->coversFullSphere() )
VA_WARN( "DirectivityDAFFIR", "The HRIR dataset file " << sFilename << " does not cover all directions" );
// Eigenschaften definieren
if( m_pReader->getProperties()->getNumberOfChannels() < 2 )
VA_EXCEPT1( std::string( "In file \"" ) + sFilename + std::string( "\": " ) + std::string( " Number of channels for a HRIR must be at least two." ) );
if( m_pReader->getProperties()->getNumberOfChannels() > 2 )
VA_WARN( "DirectivityDAFFIR", "The HRIR dataset file " << sFilename << " has more than two channels, but will only use first two (left, right)" );
m_oProps.sFilename = sFilename;
m_oProps.sName = sName;
m_oProps.iFilterLength = m_iFilterLength;
......
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