Commit 3d4c2f59 authored by Lucas Moesch's avatar Lucas Moesch

Merged with lates develop.

parents 9f7c8156 22757c5b
......@@ -2,6 +2,8 @@ conf/VACore.ini
conf/VACore.experimental.ini
conf/*.ini
*.log
*.daff
*.sofa
*.wav
HTML
*.bat
......
......@@ -65,7 +65,7 @@ if( NOT DEFINED ITA_VACORE_VERSION_MAJOR )
set( ITA_VACORE_VERSION_MAJOR "v2018" CACHE STRING "VACore version major (usually 'v' and year)" )
endif( )
if( NOT DEFINED ITA_VACORE_VERSION_MINOR )
set( ITA_VACORE_VERSION_MINOR "a" CACHE STRING "VACore version minor (usually a,b,c ...)" )
set( ITA_VACORE_VERSION_MINOR "b" CACHE STRING "VACore version minor (usually a,b,c ...)" )
endif( )
# Settings
......
#
# -------------------------------------------------------------------------------------------
#
# VVV VVV A
# VVV VVV AAA Virtual Acoustics (VA)
# VVV VVV AAA Real-time auralisation for virtual reality
# VVV VVV AAA
# VVVVVV AAA (c) Copyright Institut of Technical Acoustics (ITA)
# VVVV AAA RWTH Aachen University (http://www.akustik.rwth-aachen.de)
#
# -------------------------------------------------------------------------------------------
#
# This minimalistic configuration file is an example how to simulate and record
# the audio stream of a binaural rendering with headphone-equalized output.
#
[Paths]
conf_dir = conf
data_dir = data
[Macros]
DemoSound = WelcomeToVA.wav
DefaultHRIR = ITA_Artificial_Head_5x5_44kHz_128.v17.ir.daff
ProjectName = MyOfflineRecordingProject
[Debug]
LogLevel = 4
[Audio driver]
Driver = Virtual
Device = trigger
Samplerate = 44100
Buffersize = 64
OutputChannels = 2
[Renderer:MyBinauralFreeField]
Class = BinauralFreeField
Enabled = true
Reproductions = MyHeadphones
RecordOutputEnabled = true
RecordOutputFilePath = $(ProjectName)_rendering.wav
[Reproduction:MyHeadphones]
Class = Headphones
Enabled = true
HpIRInvFile = HD650_all_inv.wav
HpIRInvCalibrationGainDecibel = 0.1
Outputs = MyDesktopHP
RecordOutputEnabled = true
RecordOutputFilePath = $(ProjectName)_reproduction.wav
[Setup]
[Output:MyDesktopHP]
Description = Desktop user with headphones
Devices = MyHP
[OutputDevice:MyHP]
Type = HP
Description = Headphone hardware device (two-channels)
Channels = 1,2
......@@ -183,7 +183,7 @@ const float* CVAMachineSignalSource::GetStreamBlock( const CVAAudiostreamState*
if( m_bCrossfadeSounds )
{
// Fade in stopping sample buffer
m_sbOut.Crossfade( sbOutTemp, 0, iSamplesWritten, ITA_FADE_IN, ITASampleBuffer::COSINE_SQUARE );
m_sbOut.Crossfade( sbOutTemp, 0, iSamplesWritten, ITABase::CrossfadeDirection::FROM_SOURCE, ITABase::FadingFunction::COSINE_SQUARE );
}
else
{
......
......@@ -873,11 +873,11 @@ void CVABinauralAirTrafficNoiseAudioRenderer::ProcessStream( const ITAStreamInfo
pPath->oRefSoundPath.pThirdOctaveFilterBank->Process( ctxAudio.m_sbTempBufR.data(), ctxAudio.m_sbTempBufR.data() ); // inplace
pPath->oDirSoundPath.pFIRConvolverChL->Process( ctxAudio.m_sbTempBufD.data(), ( *pPath->pSoundReceiver->psfOutput )[ 0 ].data(), ITAUPConvolution::OUTPUT_MIX );
pPath->oRefSoundPath.pFIRConvolverChL->Process( ctxAudio.m_sbTempBufR.data(), ( *pPath->pSoundReceiver->psfOutput )[ 0 ].data(), ITAUPConvolution::OUTPUT_MIX );
pPath->oDirSoundPath.pFIRConvolverChL->Process( ctxAudio.m_sbTempBufD.data(), ( *pPath->pSoundReceiver->psfOutput )[ 0 ].data(), ITABase::MixingMethod::ADD );
pPath->oRefSoundPath.pFIRConvolverChL->Process( ctxAudio.m_sbTempBufR.data(), ( *pPath->pSoundReceiver->psfOutput )[ 0 ].data(), ITABase::MixingMethod::ADD );
pPath->oDirSoundPath.pFIRConvolverChR->Process( ctxAudio.m_sbTempBufD.data(), ( *pPath->pSoundReceiver->psfOutput )[ 1 ].data(), ITAUPConvolution::OUTPUT_MIX );
pPath->oRefSoundPath.pFIRConvolverChR->Process( ctxAudio.m_sbTempBufR.data(), ( *pPath->pSoundReceiver->psfOutput )[ 1 ].data(), ITAUPConvolution::OUTPUT_MIX );
pPath->oDirSoundPath.pFIRConvolverChR->Process( ctxAudio.m_sbTempBufD.data(), ( *pPath->pSoundReceiver->psfOutput )[ 1 ].data(), ITABase::MixingMethod::ADD );
pPath->oRefSoundPath.pFIRConvolverChR->Process( ctxAudio.m_sbTempBufR.data(), ( *pPath->pSoundReceiver->psfOutput )[ 1 ].data(), ITABase::MixingMethod::ADD );
spit++;
}
......@@ -1259,10 +1259,10 @@ CVABATNSoundPath::CVABATNSoundPath( double dSamplerate, int iBlocklength, int iH
oRefSoundPath.pFIRConvolverChL = new ITAUPConvolution( iBlocklength, iHRIRFilterLength );
oDirSoundPath.pFIRConvolverChR = new ITAUPConvolution( iBlocklength, iHRIRFilterLength );
oRefSoundPath.pFIRConvolverChR = new ITAUPConvolution( iBlocklength, iHRIRFilterLength );
oDirSoundPath.pFIRConvolverChL->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
oRefSoundPath.pFIRConvolverChL->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
oDirSoundPath.pFIRConvolverChR->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
oRefSoundPath.pFIRConvolverChR->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
oDirSoundPath.pFIRConvolverChL->SetFilterExchangeFadingFunction( ITABase::FadingFunction::COSINE_SQUARE );
oRefSoundPath.pFIRConvolverChL->SetFilterExchangeFadingFunction( ITABase::FadingFunction::COSINE_SQUARE );
oDirSoundPath.pFIRConvolverChR->SetFilterExchangeFadingFunction( ITABase::FadingFunction::COSINE_SQUARE );
oRefSoundPath.pFIRConvolverChR->SetFilterExchangeFadingFunction( ITABase::FadingFunction::COSINE_SQUARE );
oDirSoundPath.pFIRConvolverChL->SetFilterCrossfadeLength( ( std::min )( iBlocklength, 32 ) );
oRefSoundPath.pFIRConvolverChL->SetFilterCrossfadeLength( ( std::min )( iBlocklength, 32 ) );
oDirSoundPath.pFIRConvolverChR->SetFilterCrossfadeLength( ( std::min )( iBlocklength, 32 ) );
......
......@@ -509,8 +509,7 @@ void CVABinauralArtificialReverbAudioRenderer::Reset()
{
CBARPath* pPath( *it );
int iNumRefs = pPath->GetNumReferences();
assert( iNumRefs == 1 );
assert( pPath->GetNumReferences() == 1 );
pPath->RemoveReference();
++it;
......@@ -828,8 +827,8 @@ void CVABinauralArtificialReverbAudioRenderer::ProcessStream( const ITAStreamInf
const float* pfIn = pListener->psbInput->data();
float* pfOutL = ( *pListener->psfOutput )[ 0 ].data();
float* pfOutR = ( *pListener->psfOutput )[ 1 ].data();
pListener->pConvolverL->Process( pfIn, pfOutL, ITAUPConvolution::OUTPUT_OVERWRITE );
pListener->pConvolverR->Process( pfIn, pfOutR, ITAUPConvolution::OUTPUT_OVERWRITE );
pListener->pConvolverL->Process( pfIn, pfOutL, ITABase::MixingMethod::OVERWRITE );
pListener->pConvolverR->Process( pfIn, pfOutR, ITABase::MixingMethod::OVERWRITE );
pListener->psbInput->Zero(); // clear input for next block
......@@ -991,11 +990,11 @@ CVABinauralArtificialReverbAudioRenderer::Listener* CVABinauralArtificialReverbA
pListener->psbInput = new ITASampleBuffer( GetBlocklength(), true );
pListener->pConvolverL = new ITAUPConvolution( GetBlocklength(), m_iMaxReverbFilterLengthSamples );
pListener->pConvolverL->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pListener->pConvolverL->SetFilterExchangeFadingFunction( ITABase::FadingFunction::COSINE_SQUARE );
pListener->pConvolverL->SetFilterCrossfadeLength( ( std::min )( int( GetBlocklength() ), 32 ) );
pListener->pConvolverR = new ITAUPConvolution( GetBlocklength(), m_iMaxReverbFilterLengthSamples );
pListener->pConvolverR->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pListener->pConvolverR->SetFilterExchangeFadingFunction( ITABase::FadingFunction::COSINE_SQUARE );
pListener->pConvolverR->SetFilterCrossfadeLength( ( std::min )( int( GetBlocklength() ), 32 ) );
assert( pListener->pData );
......
......@@ -763,8 +763,8 @@ void CVABinauralFreeFieldAudioRenderer::ProcessStream( const ITAStreamInfo* pStr
pPath->pThirdOctaveFilterBank->Process( psbInput->data(), ctxAudio.m_sbTempL.data() );
pPath->pVariableDelayLineChR->Process( &( ctxAudio.m_sbTempL ), &( ctxAudio.m_sbTempR ) );
pPath->pVariableDelayLineChL->Process( &( ctxAudio.m_sbTempL ), &( ctxAudio.m_sbTempL ) ); // inplace
pPath->pFIRConvolverChL->Process( ctxAudio.m_sbTempL.data(), ( *pPath->pListener->psfOutput )[ 0 ].data(), ITAUPConvolution::OUTPUT_MIX );
pPath->pFIRConvolverChR->Process( ctxAudio.m_sbTempR.data(), ( *pPath->pListener->psfOutput )[ 1 ].data(), ITAUPConvolution::OUTPUT_MIX );
pPath->pFIRConvolverChL->Process( ctxAudio.m_sbTempL.data(), ( *pPath->pListener->psfOutput )[ 0 ].data(), ITABase::MixingMethod::ADD );
pPath->pFIRConvolverChR->Process( ctxAudio.m_sbTempR.data(), ( *pPath->pListener->psfOutput )[ 1 ].data(), ITABase::MixingMethod::ADD );
spit++;
}
......@@ -1162,7 +1162,7 @@ CVABFFSoundPath::CVABFFSoundPath( double dSamplerate, int iBlocklength, int iHRI
pVariableDelayLineChR = new CITAVariableDelayLine( dSamplerate, iBlocklength, fReserverdMaxDelaySamples, m_iDefaultVDLSwitchingAlgorithm );
pFIRConvolverChL = new ITAUPConvolution( iBlocklength, iHRIRFilterLength );
pFIRConvolverChL->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pFIRConvolverChL->SetFilterExchangeFadingFunction( ITABase::FadingFunction::COSINE_SQUARE );
pFIRConvolverChL->SetFilterCrossfadeLength( ( std::min )( iBlocklength, 32 ) );
pFIRConvolverChL->SetGain( 0.0f, true );
ITAUPFilter* pHRIRFilterChL = pFIRConvolverChL->RequestFilter();
......@@ -1170,7 +1170,7 @@ CVABFFSoundPath::CVABFFSoundPath( double dSamplerate, int iBlocklength, int iHRI
pFIRConvolverChL->ExchangeFilter( pHRIRFilterChL );
pFIRConvolverChR = new ITAUPConvolution( iBlocklength, iHRIRFilterLength );
pFIRConvolverChR->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pFIRConvolverChR->SetFilterExchangeFadingFunction( ITABase::FadingFunction::COSINE_SQUARE );
pFIRConvolverChR->SetFilterCrossfadeLength( ( std::min )( iBlocklength, 32 ) );
pFIRConvolverChR->SetGain( 0.0f, true );
ITAUPFilter* pHRIRFilterChR = pFIRConvolverChR->RequestFilter();
......
......@@ -492,10 +492,10 @@ CVABATNSoundPath::CVABATNSoundPath( double dSamplerate, int iBlocklength, int iH
oRefSoundPath.pFIRConvolverChL = new ITAUPConvolution( iBlocklength, iHRIRFilterLength );
oDirSoundPath.pFIRConvolverChR = new ITAUPConvolution( iBlocklength, iHRIRFilterLength );
oRefSoundPath.pFIRConvolverChR = new ITAUPConvolution( iBlocklength, iHRIRFilterLength );
oDirSoundPath.pFIRConvolverChL->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
oRefSoundPath.pFIRConvolverChL->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
oDirSoundPath.pFIRConvolverChR->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
oRefSoundPath.pFIRConvolverChR->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
oDirSoundPath.pFIRConvolverChL->SetFilterExchangeFadingFunction( ITABase::FadingFunction::COSINE_SQUARE );
oRefSoundPath.pFIRConvolverChL->SetFilterExchangeFadingFunction( ITABase::FadingFunction::COSINE_SQUARE );
oDirSoundPath.pFIRConvolverChR->SetFilterExchangeFadingFunction( ITABase::FadingFunction::COSINE_SQUARE );
oRefSoundPath.pFIRConvolverChR->SetFilterExchangeFadingFunction( ITABase::FadingFunction::COSINE_SQUARE );
oDirSoundPath.pFIRConvolverChL->SetFilterCrossfadeLength( ( std::min )( iBlocklength, 32 ) );
oRefSoundPath.pFIRConvolverChL->SetFilterCrossfadeLength( ( std::min )( iBlocklength, 32 ) );
oDirSoundPath.pFIRConvolverChR->SetFilterCrossfadeLength( ( std::min )( iBlocklength, 32 ) );
......
......@@ -549,7 +549,7 @@ ComplexSoundPath::ComplexSoundPath( double dSamplerate, int iBlocklength, int iR
// Falter
int iRIRConvolverLength = pParentFilterPool->GetMaxFilterlength();
pRIRConvolverCh0 = new ITAUPConvolution( iBlocklength, iRIRConvolverLength, pParentFilterPool );
pRIRConvolverCh0->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pRIRConvolverCh0->SetFilterExchangeFadingFunction( ITABase::FadingFunction::COSINE_SQUARE );
pRIRConvolverCh0->SetFilterCrossfadeLength( ( std::min )( iBlocklength, 32 ) );
ITAUPFilter* pRIRFilterCh0 = pRIRConvolverCh0->RequestFilter();
pRIRFilterCh0->Zeros();
......@@ -557,7 +557,7 @@ ComplexSoundPath::ComplexSoundPath( double dSamplerate, int iBlocklength, int iR
pRIRConvolverCh0->ReleaseFilter( pRIRFilterCh0 );
pRIRConvolverCh1 = new ITAUPConvolution( iBlocklength, iRIRConvolverLength, pParentFilterPool );
pRIRConvolverCh1->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pRIRConvolverCh1->SetFilterExchangeFadingFunction( ITABase::FadingFunction::COSINE_SQUARE );
pRIRConvolverCh1->SetFilterCrossfadeLength( ( std::min )( iBlocklength, 32 ) );
ITAUPFilter* pRIRFilterCh1 = pRIRConvolverCh1->RequestFilter();
pRIRFilterCh1->Zeros();
......@@ -1853,12 +1853,12 @@ void CVARoomAcousticsAudioRenderer::ProcessStream( const ITAStreamInfo* pStreamI
}
pPath->pMediumPropagationVDL->Process( psbInput, &m_psbVDLTempOut );
pPath->pRIRConvolverCh0->Process( m_psbVDLTempOut.data(), pfOutputCh0, ITAUPConvolution::OUTPUT_MIX );
pPath->pRIRConvolverCh1->Process( m_psbVDLTempOut.data(), pfOutputCh1, ITAUPConvolution::OUTPUT_MIX );
pPath->pRIRConvolverCh0->Process( m_psbVDLTempOut.data(), pfOutputCh0, ITABase::MixingMethod::ADD );
pPath->pRIRConvolverCh1->Process( m_psbVDLTempOut.data(), pfOutputCh1, ITABase::MixingMethod::ADD );
// Direct in, no VDL
//pPath->pRIRConvolverCh0->process(psbInput->data(), pfOutputCh0, ITAUPConvolution::OUTPUT_MIX );
//pPath->pRIRConvolverCh1->process(psbInput->data(), pfOutputCh1, ITAUPConvolution::OUTPUT_MIX );
//pPath->pRIRConvolverCh0->process(psbInput->data(), pfOutputCh0, ITABase::MixingMethod::ADD );
//pPath->pRIRConvolverCh1->process(psbInput->data(), pfOutputCh1, ITABase::MixingMethod::ADD );
pPath->oProfiler.dLastConvProcessing = pPath->oProfiler.swConvolve.stop();
m_swConvolveStream.stop();
......
......@@ -760,7 +760,7 @@ void CVAPrototypeFreeFieldAudioRenderer::ProcessStream( const ITAStreamInfo* pSt
{
ITASampleBuffer& sfTarget = ( *pPath->pReceiver->psfOutput )[ i ];
ITAUPConvolution* pFIRConvolver = pPath->vpFIRFilterBanks[ i ];
pFIRConvolver->Process( ctxAudio.m_sbTemp.data(), sfTarget.GetData(), ITAUPConvolution::OUTPUT_MIX );
pFIRConvolver->Process( ctxAudio.m_sbTemp.data(), sfTarget.GetData(), ITABase::MixingMethod::ADD );
}
spit++;
......
......@@ -143,7 +143,7 @@ CVAPTGenericSoundPath::CVAPTGenericSoundPath( double dSamplerate, int iBlockleng
for( int n = 0; n < iNumChannels; n++ )
{
ITAUPConvolution* pFIRConvolver = new ITAUPConvolution( iBlocklength, iIRFilterLength );
pFIRConvolver->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pFIRConvolver->SetFilterExchangeFadingFunction( ITABase::FadingFunction::COSINE_SQUARE );
pFIRConvolver->SetFilterCrossfadeLength( ( std::min )( iBlocklength, 32 ) );
pFIRConvolver->SetGain( 1.0f, true );
ITAUPFilter* pHRIRFilterChL = pFIRConvolver->RequestFilter();
......@@ -824,7 +824,7 @@ void CVAPTGenericPathAudioRenderer::HandleProcessStream( ITADatasourceRealizatio
{
ITAUPConvolution* pConvolver = pPath->vpFIRConvolver[ n ];
pConvolver->SetGain( fSoundSourceGain );
pConvolver->Process( m_sfTempBuffer.GetData(), ( *pPath->pListener->psfOutput )[ n ].data(), ITAUPConvolution::OUTPUT_MIX );
pConvolver->Process( m_sfTempBuffer.GetData(), ( *pPath->pListener->psfOutput )[ n ].data(), ITABase::MixingMethod::ADD );
}
spit++;
......
......@@ -405,7 +405,7 @@ void CVAPTHearingAidRenderer::Reset()
{
ctxAudio.m_iResetFlag = 1; // Request reset
if( ctxAudio.m_iStatus == 0 || m_oParams.bOfflineRendering )
if( ctxAudio.m_iStatus == 0 || oParams.bOfflineRendering )
{
// if no streaming active, reset manually
//SyncInternalData();
......@@ -740,10 +740,10 @@ void CVAPTHearingAidRenderer::ProcessStream( const ITAStreamInfo* pStreamInfo )
pPath->pVariableDelayLine->Process( psbInput, &( ctxAudio.m_sbTemp ) );
pPath->pThirdOctaveFilterBank->Process( ctxAudio.m_sbTemp.data(), ctxAudio.m_sbTemp.data() ); // inplace
pPath->pFIRConvolverChL1->Process( ctxAudio.m_sbTemp.data(), ( *pPath->pListener->psfOutput )[ 0 ].data(), ITAUPConvolution::OUTPUT_MIX );
pPath->pFIRConvolverChR1->Process( ctxAudio.m_sbTemp.data(), ( *pPath->pListener->psfOutput )[ 1 ].data(), ITAUPConvolution::OUTPUT_MIX );
pPath->pFIRConvolverChL2->Process( ctxAudio.m_sbTemp.data(), ( *pPath->pListener->psfOutput )[ 2 ].data(), ITAUPConvolution::OUTPUT_MIX );
pPath->pFIRConvolverChR2->Process( ctxAudio.m_sbTemp.data(), ( *pPath->pListener->psfOutput )[ 3 ].data(), ITAUPConvolution::OUTPUT_MIX );
pPath->pFIRConvolverChL1->Process( ctxAudio.m_sbTemp.data(), ( *pPath->pListener->psfOutput )[ 0 ].data(), ITABase::MixingMethod::ADD );
pPath->pFIRConvolverChR1->Process( ctxAudio.m_sbTemp.data(), ( *pPath->pListener->psfOutput )[ 1 ].data(), ITABase::MixingMethod::ADD );
pPath->pFIRConvolverChL2->Process( ctxAudio.m_sbTemp.data(), ( *pPath->pListener->psfOutput )[ 2 ].data(), ITABase::MixingMethod::ADD );
pPath->pFIRConvolverChR2->Process( ctxAudio.m_sbTemp.data(), ( *pPath->pListener->psfOutput )[ 3 ].data(), ITABase::MixingMethod::ADD );
spit++;
}
......@@ -1211,7 +1211,7 @@ CVAPTHASoundPath::CVAPTHASoundPath( double dSamplerate, int iBlocklength, int iH
pVariableDelayLine = new CITAVariableDelayLine( dSamplerate, iBlocklength, fReserverdMaxDelaySamples, m_iDefaultVDLSwitchingAlgorithm );
pFIRConvolverChL1 = new ITAUPConvolution( iBlocklength, iHRIRFilterLength );
pFIRConvolverChL1->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pFIRConvolverChL1->SetFilterExchangeFadingFunction( ITABase::FadingFunction::COSINE_SQUARE );
pFIRConvolverChL1->SetFilterCrossfadeLength( ( std::min )( iBlocklength, 32 ) );
pFIRConvolverChL1->SetGain( 0, true );
ITAUPFilter* pHRIRFilterChL1 = pFIRConvolverChL1->RequestFilter();
......@@ -1219,7 +1219,7 @@ CVAPTHASoundPath::CVAPTHASoundPath( double dSamplerate, int iBlocklength, int iH
pFIRConvolverChL1->ExchangeFilter( pHRIRFilterChL1 );
pFIRConvolverChL2 = new ITAUPConvolution( iBlocklength, iHRIRFilterLength );
pFIRConvolverChL2->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pFIRConvolverChL2->SetFilterExchangeFadingFunction( ITABase::FadingFunction::COSINE_SQUARE );
pFIRConvolverChL2->SetFilterCrossfadeLength( ( std::min )( iBlocklength, 32 ) );
pFIRConvolverChL2->SetGain( 0, true );
ITAUPFilter* pHRIRFilterChL2 = pFIRConvolverChL2->RequestFilter();
......@@ -1227,7 +1227,7 @@ CVAPTHASoundPath::CVAPTHASoundPath( double dSamplerate, int iBlocklength, int iH
pFIRConvolverChL2->ExchangeFilter( pHRIRFilterChL2 );
pFIRConvolverChR1 = new ITAUPConvolution( iBlocklength, iHRIRFilterLength );
pFIRConvolverChR1->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pFIRConvolverChR1->SetFilterExchangeFadingFunction( ITABase::FadingFunction::COSINE_SQUARE );
pFIRConvolverChR1->SetFilterCrossfadeLength( ( std::min )( iBlocklength, 32 ) );
pFIRConvolverChR1->SetGain( 0, true );
ITAUPFilter* pHRIRFilterChR1 = pFIRConvolverChR1->RequestFilter();
......@@ -1235,7 +1235,7 @@ CVAPTHASoundPath::CVAPTHASoundPath( double dSamplerate, int iBlocklength, int iH
pFIRConvolverChR1->ExchangeFilter( pHRIRFilterChR1 );
pFIRConvolverChR2 = new ITAUPConvolution( iBlocklength, iHRIRFilterLength );
pFIRConvolverChR2->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pFIRConvolverChR2->SetFilterExchangeFadingFunction( ITABase::FadingFunction::COSINE_SQUARE );
pFIRConvolverChR2->SetFilterCrossfadeLength( ( std::min )( iBlocklength, 32 ) );
pFIRConvolverChR2->SetGain( 0, true );
ITAUPFilter* pHRIRFilterChR2 = pFIRConvolverChR2->RequestFilter();
......
......@@ -82,40 +82,43 @@ void CVAAudioRendererRegistry::RegisterInternalCoreFactoryMethods()
// Binaural
#ifdef VACORE_WITH_RENDERER_BINAURAL_FREE_FIELD
RegisterRendererDefaultFactory< CVABinauralFreeFieldAudioRenderer >( "BinauralFreeField" );
#endif // VACORE_WITH_RENDERER_BINAURAL_FREE_FIELD
#endif
#ifdef VACORE_WITH_RENDERER_BINAURAL_AIR_TRAFFIC_NOISE
RegisterRendererDefaultFactory< CVABinauralAirTrafficNoiseAudioRenderer >( "BinauralAirTrafficNoise" );
#endif // VACORE_WITH_RENDERER_BINAURAL_AIR_TRAFFIC_NOISE
#endif
#ifdef VACORE_WITH_RENDERER_BINAURAL_ARTIFICIAL_REVERB
RegisterRendererDefaultFactory< CVABinauralArtificialReverbAudioRenderer >( "BinauralArtificialReverb" );
#endif // VACORE_WITH_RENDERER_BINAURAL_ARTIFICIAL_REVERB
#endif
#ifdef VACORE_WITH_RENDERER_BINAURAL_ROOM_ACOUSTICS
RegisterRendererDefaultFactory< CVARoomAcousticsAudioRenderer>( "BinauralRoomAcoustics" );
<<<<<<< HEAD
#endif // VACORE_WITH_RENDERER_BINAURAL_ROOM_ACOUSTICS
#ifdef VACORE_WITH_RENDERER_BINAURAL_REAL_TIME
RegisterRendererDefaultFactory< VABinauralRealTimeRenderer>("BinauralRealTime");
#endif // VACORE_WITH_RENDERER_BINAURAL_REAL_TIME
=======
#endif
>>>>>>> develop
// Prototyping
#ifdef VACORE_WITH_RENDERER_PROTOTYPE_FREE_FIELD
RegisterRendererDefaultFactory< CVAPrototypeFreeFieldAudioRenderer >( "PrototypeFreeField" );
#endif // VACORE_WITH_RENDERER_PROTOTYPE_FREE_FIELD
#endif
#ifdef VACORE_WITH_RENDERER_PROTOTYPE_DUMMY
RegisterRendererDefaultFactory< CVAPTDummyAudioRenderer >( "PrototypeDummy" );
#endif // VACORE_WITH_RENDERER_PROTOTYPE_DUMMY
#endif
#ifdef VACORE_WITH_RENDERER_PROTOTYPE_GENERIC_PATH
//VA_REGISTER_AUDIO_RENDERER( CVAPTGenericPathAudioRenderer, "GenericPath" );
RegisterRendererDefaultFactory< CVAPTGenericPathAudioRenderer >( "PrototypeGenericPath" );
#endif // VACORE_WITH_RENDERER_PROTOTYPE_GENERIC_PATH
#endif
#ifdef VACORE_WITH_RENDERER_PROTOTYPE_HEARING_AID
RegisterRendererDefaultFactory< CVAPTHearingAidRenderer >( "PrototypeHearingAid" );
#endif // VACORE_WITH_RENDERER_PROTOTYPE_HEARING_AID
#endif
// VBAP
#ifdef VACORE_WITH_RENDERER_VBAP_FREE_FIELD
RegisterRendererDefaultFactory< CVAVBAPFreeFieldAudioRenderer >( "VBAPFreeField" );
#endif // VACORE_WITH_RENDERER_VBAP_FREE_FIELD
#endif
m_bInternalCoreFactoriesRegistered = true;
}
......@@ -294,7 +294,7 @@ CMixdownStreamFilter::CMixdownStreamFilter( int iNumLoudspeaker, double dSampleR
{
ITAUPConvolution* pConvolver = new ITAUPConvolution( (int) GetBlocklength(), iMaxFilterLength, pFilterPool );
pConvolver->SetFilterExchangeTrigger( pTrigger );
pConvolver->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pConvolver->SetFilterExchangeFadingFunction( ITABase::FadingFunction::COSINE_SQUARE );
pConvolver->SetFilterCrossfadeLength( (int) GetBlocklength() );
pConvolver->ExchangeFilter( pDirac );
......@@ -326,7 +326,7 @@ void CMixdownStreamFilter::ProcessStream( const ITAStreamInfo* pStreamInfo )
int iIndexLeft = 2*i+0;
int iIndexRight = 2*i+1;
const float* pfInputData = pdsInput->GetBlockPointer( i, pStreamInfo );
int iWriteMode = ( i == 0 ) ? ITAUPConvolution::OUTPUT_OVERWRITE : ITAUPConvolution::OUTPUT_MIX;
int iWriteMode = ( i == 0 ) ? ITABase::MixingMethod::OVERWRITE : ITABase::MixingMethod::ADD;
vpConvolver[iIndexLeft]->Process( pfInputData, pfBinauralOutputDataChL, iWriteMode );
vpConvolver[iIndexRight]->Process( pfInputData, pfBinauralOutputDataChR, iWriteMode );
}
......
......@@ -217,7 +217,7 @@ StreamFilter::StreamFilter( int iNumChannels, double dSampleRate, int iBlockLeng
{
ITAUPConvolution* pConvolver = new ITAUPConvolution( (int) GetBlocklength(), iMaxFilterLength, pFilterPool );
pConvolver->SetFilterExchangeTrigger( pTrigger );
pConvolver->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pConvolver->SetFilterExchangeFadingFunction( ITABase::FadingFunction::COSINE_SQUARE );
pConvolver->SetFilterCrossfadeLength( (int) GetBlocklength() );
pConvolver->ExchangeFilter( pDirac );
......@@ -246,7 +246,7 @@ void StreamFilter::ProcessStream( const ITAStreamInfo* pStreamInfo )
int iIndexLeft = 2*i+0;
int iIndexRight = 2*i+1;
const float* pfInputData = pdsInput->GetBlockPointer( i, pStreamInfo );
int iWriteMode = ( i == 0 ) ? ITAUPConvolution::OUTPUT_OVERWRITE : ITAUPConvolution::OUTPUT_MIX;
int iWriteMode = ( i == 0 ) ? ITABase::MixingMethod::OVERWRITE : ITABase::MixingMethod::ADD;
vpConvolver[iIndexLeft]->Process( pfInputData, pfBinauralOutputDataChL, iWriteMode );
vpConvolver[iIndexRight]->Process( pfInputData, pfBinauralOutputDataChR, iWriteMode );
}
......
......@@ -85,7 +85,11 @@ CVAHeadphonesReproduction::CVAHeadphonesReproduction( const CVAAudioReproduction
std::string sFilePath = m_oParams.pCore->GetCoreConfig()->mMacros.SubstituteMacros( sFilePathRaw ); ;
m_sfHpIRInv.Load( m_oParams.pCore->FindFilePath( sFilePath ) ); // sets length to given number of samples
std::string sFinalFilePath = oParams.pCore->FindFilePath( sFilePath );
if( !doesPathExist( sFinalFilePath ) )
VA_EXCEPT2( INVALID_PARAMETER, "Headphone EQ impulse response file '" + sFilePath + "' could not be found. Please make sure the directory is added as a search path." );
m_sfHpIRInv.Load( sFinalFilePath ); // sets length to given number of samples
if( m_sfHpIRInv.channels() != 2 )
VA_EXCEPT2( INVALID_PARAMETER, "Headphone EQ impulse response '" + sFilePath + "' requires two channels" );
......@@ -272,10 +276,10 @@ HPEQStreamFilter::HPEQStreamFilter( double dSampleRate, int iBlockLength, const
, fGain( 1.0f )
{
pConvolverLeft = new ITAUPConvolution( GetBlocklength(), sfHpIRinv.length() );
pConvolverLeft->SetFilterExchangeMode( ITAUPConvolution::SWITCH );
pConvolverLeft->SetFilterExchangeFadingFunction( ITABase::FadingFunction::SWITCH );
pConvolverRight = new ITAUPConvolution( GetBlocklength(), sfHpIRinv.length() );
pConvolverRight->SetFilterExchangeMode( ITAUPConvolution::SWITCH );
pConvolverRight->SetFilterExchangeFadingFunction( ITABase::FadingFunction::SWITCH );
ExchangeFilter( sfHpIRinv );
}
......@@ -313,8 +317,8 @@ void HPEQStreamFilter::ProcessStream( const ITAStreamInfo* pStreamInfo )
const float* pfInputDataLeft = pdsInput->GetBlockPointer( 0, pStreamInfo );
const float* pfInputDataRight = pdsInput->GetBlockPointer( 1, pStreamInfo );
pConvolverLeft->Process( pfInputDataLeft, pfBinauralOutputDataChL, ITAUPConvolution::OUTPUT_OVERWRITE );
pConvolverRight->Process( pfInputDataRight, pfBinauralOutputDataChR, ITAUPConvolution::OUTPUT_OVERWRITE );
pConvolverLeft->Process( pfInputDataLeft, pfBinauralOutputDataChL, ITABase::MixingMethod::OVERWRITE );
pConvolverRight->Process( pfInputDataRight, pfBinauralOutputDataChR, ITABase::MixingMethod::OVERWRITE );
pConvolverLeft->SetGain( fGain );
pConvolverRight->SetGain( fGain );
......
......@@ -137,7 +137,7 @@ CVANCTCReproduction::CVANCTCReproduction( const CVAAudioReproductionInitParams&
oNCTCStreamConf.iFilterLength = oNCTCConf.iCTCFilterLength;
conf.OptInteger( "CTCFilterCrossfadeLength", oNCTCStreamConf.iFilterCrossfadeLength, 128 );
conf.OptInteger( "CTCFilterExchangeMode", oNCTCStreamConf.iFilterExchangeMode, ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
conf.OptInteger( "CTCFilterExchangeMode", oNCTCStreamConf.iFilterExchangeMode, ITABase::FadingFunction::COSINE_SQUARE );
conf.OptBool( "UseTrackedListenerHRIR", m_bTrackedListenerHRIR, false );
......
......@@ -23,6 +23,7 @@
#include <VistaBase/VistaTimeUtils.h>
#include <VistaBase/VistaQuaternion.h>
#include <VistaTools/VistaFileSystemFile.h>
#include <cassert>
......@@ -146,16 +147,20 @@ CVAStructValue interpretStructKey( const std::string& s )
void LoadStructFromINIFIle( const std::string& sFilePath, CVAStruct& oData )
{
if( !doesFileExist( sFilePath ) )
if( !VistaFileSystemFile( sFilePath ).Exists() )
VA_EXCEPT2( FILE_NOT_FOUND, std::string( "INI file \"" ) + sFilePath + std::string( "\" not found" ) );
INIFileUseFile( sFilePath );
oData.Clear();
std::vector<std::string> vsSections = INIFileGetSections( sFilePath );
auto vsSections = INIFileGetSections( sFilePath );
for( std::vector<std::string>::iterator it = vsSections.begin(); it != vsSections.end(); ++it )
{
std::string& sSection( *it );
std::vector<std::string> vsKeys = INIFileGetKeys( sFilePath, sSection );
INIFileUseSection( sSection );
std::vector<std::string> vsKeys = INIFileGetKeys( sSection );
// Spezialfall: Section [] nach Root abbilden
if( it->empty() )
......@@ -165,7 +170,8 @@ void LoadStructFromINIFIle( const std::string& sFilePath, CVAStruct& oData )
std::string& sKey( *jt );
if( oData.HasKey( sKey ) )
VA_EXCEPT2( INVALID_PARAMETER, "Uniqueness violation in " + sFilePath + ": multiple detection of key '" + sKey + "' in section '" + sSection + "'" );
oData[ sKey ] = interpretStructKey( INIFileReadString( sFilePath, sSection, sKey ) );
const std::string sValue = INIFileReadString( sKey );
oData[ sKey ] = interpretStructKey( sValue );
}
}
else
......@@ -176,7 +182,9 @@ void LoadStructFromINIFIle( const std::string& sFilePath, CVAStruct& oData )
std::string& sKey( *jt );
if( oData.HasKey( sKey ) )
VA_EXCEPT2( INVALID_PARAMETER, "Uniqueness violation in " + sFilePath + ": multiple detection of key '" + sKey + "' in section '" + sSection + "'" );
oSubData[ *jt ] = interpretStructKey( INIFileReadString( sFilePath, sSection, sKey ) );
const std::string sValue = INIFileReadString( sKey );
oSubData[ sKey ] = interpretStructKey( sValue );
}
oData[ sSection ] = oSubData;
}
......
......@@ -200,8 +200,14 @@ void VACore::StoreCoreConfigToFile( const CVAStruct& oConfig, const std::string&
CVAStruct VACore::LoadCoreConfigFromFile( const std::string& sConfigFilePath )
{
CVAStruct oFinalCoreConfigStruct, oCurrentConfig;
VistaFileSystemFile oConfigFile( sConfigFilePath );
std::list< VistaFileSystemFile > voConfigFiles;
std::vector< VistaFileSystemDirectory > voIncludePaths;
if( oConfigFile.Exists() && oConfigFile.GetParentDirectory().empty() == false )
voIncludePaths.push_back( oConfigFile.GetParentDirectory() );
voConfigFiles.push_back( VistaFileSystemFile( sConfigFilePath ) );
VA_INFO( "Core", "Working directory: '" << VistaFileSystemDirectory::GetCurrentWorkingDirectory() << "'" );
......
......@@ -78,27 +78,27 @@ int main( int, char** )
// Attach (register) event handler
//va->AttachEventHandler( &dumper );
//va->AttachEventHandler( &rendering_controller );
va->AttachEventHandler( &rendering_controller );
//CVAVersionInfo ver;
//va->GetVersionInfo( &ver );
//cout << ver.ToString() << endl;
CVAVersionInfo ver;
va->GetVersionInfo( &ver );
cout << ver.ToString() << endl;
va->Initialize();
va->AddSearchPath( "../data" );
//TestModuleInterface();
/*
TestModuleInterface();
AudioRenderers();
//AudioReproductions();
AudioReproductions();
//CreateHRIRs();
//CreateAudioSignals();
//CreateScene();
CreateHRIRs();
CreateAudioSignals();
CreateScene();
//ConnectSignals();
//TestSignalAndSourceConnections();
TestSignalAndSourceConnections();
*/
bugfix_scene_pool_clearance_issue();
......
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