Minor typo fixes

parent 8d5bdfee
......@@ -48,8 +48,8 @@ vista_use_package( ITABase REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITADSP REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITADataSources REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITAConvolution REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITACTC REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITASampler REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITACTC REQUIRED FIND_DEPENDENCIES )
vista_use_package( OpenDAFF REQUIRED )
vista_use_package( SPLINE REQUIRED )
vista_use_package( Eigen REQUIRED )
......@@ -377,6 +377,7 @@ if( ITA_VACORE_DEPLOY_WITH_COMMON_DATA )
install( FILES "data/Singer.v17.ms.daff" DESTINATION "data" )
install( FILES "data/Trumpet1.v17.ms.daff" DESTINATION "data" )
install( FILES "data/WelcomeToVA.wav" DESTINATION "data" )
install( FILES "data/ambeo_rir_ita_doorway.wav" DESTINATION "data" )
endif( )
if( ITA_VACORE_DEPLOY_WITH_COMMON_CONFIGS )
......@@ -387,6 +388,9 @@ if( ITA_VACORE_DEPLOY_WITH_COMMON_SCRIPTS )
# nothing yet
endif( )
if( ITA_VA_INSTALL_WITH_DLLS )
vista_install_all_dlls( bin )
endif( )
# tests
if( ITA_VA_WITH_TESTS OR ITA_VACORE_WITH_TESTS )
......
......@@ -6,7 +6,6 @@
[Output:HOAIdeal]
Description = Equiangular placed loudspeaker
Enabled = true
Devices = LS1, LS2, LS3, LS4, LS5, LS6, LS7, LS8, LS9, LS10, LS11, LS12, LS13, LS14, LS15, LS16, LS17, LS18, LS19, LS20, LS21, LS22, LS23, LS24, LS25
[OutputDevice:LS1]
......
......@@ -12,5 +12,6 @@ The following files are licensed under Creative Commons BY-NC-SA 4.0 by the Inst
- Singer.v17.ms.daff
- Trumpet1.v17.ms.daff
- HD650_all_inv.wav
- ambeo_rir_ita_doorway.wav
For more information, higher resolutions for academic purposes and commercial use, please contact us.
......@@ -41,6 +41,8 @@ CVAAmbientMixerAudioRenderer::CVAAmbientMixerAudioRenderer( const CVAAudioRender
, m_pCurSceneState( NULL )
, m_bIndicateReset( false )
, m_bResetAck( false )
, m_pSampler( NULL )
, m_pDataSource( NULL )
{
assert( m_oParams.vsReproductions.size() > 0 );
......@@ -74,13 +76,14 @@ CVAAmbientMixerAudioRenderer::CVAAmbientMixerAudioRenderer( const CVAAudioRender
m_pDataSource = new ITADatasourceRealization( iNumChannels, dSampleRate, iBlockLength );
m_pDataSource->SetStreamEventHandler( this );
conf.OptBool( "SignalSourceMixing", m_bSignalSourceMixingActivated, false );
conf.OptBool( "Sampler", m_bSamplerActivated, true );
if( m_bSamplerActivated )
conf.OptBool( "SignalSourceMixingEnabled", m_bSignalSourceMixingEnabled, false );
conf.OptBool( "SamplerEnabled", m_bSamplerEnabled, true );
if( m_bSamplerEnabled )
{
m_pSampler = ITASoundSampler::Create( iNumChannels, dSampleRate, iBlockLength );
m_pSampler->AddTrack( iNumChannels ); // Add one track with all channels
}
}
......@@ -100,6 +103,15 @@ void CVAAmbientMixerAudioRenderer::HandleProcessStream( ITADatasourceRealization
m_bResetAck = true;
m_bIndicateReset = false;
}
// Clear output buffers first
for( int n = 0; n < int( GetOutputDatasource()->GetNumberOfChannels() ); n++ )
{
float* pfOutBuf = m_pDataSource->GetWritePointer( ( unsigned int ) ( n ) );
fm_zero( pfOutBuf, m_pDataSource->GetBlocklength() );
}
// Mix sound source signals
if( m_pNewSceneState )
{
......@@ -108,21 +120,8 @@ void CVAAmbientMixerAudioRenderer::HandleProcessStream( ITADatasourceRealization
m_pCurSceneState = m_pNewSceneState;
m_pNewSceneState = NULL;
}
else
{
if( m_pCurSceneState == nullptr )
return;
}
// Clear output buffers first
for( int n = 0; n < int( GetOutputDatasource()->GetNumberOfChannels() ); n++ )
{
float* pfOutBuf = m_pDataSource->GetWritePointer( ( unsigned int ) ( n ) );
fm_zero( pfOutBuf, m_pDataSource->GetBlocklength() );
}
if( m_bSignalSourceMixingActivated )
if( m_bSignalSourceMixingEnabled && m_pCurSceneState )
{
// Gather all incoming audio streams from sound sources and mix them to the output stream
std::vector< int > viSoundSourceIDs;
......@@ -154,7 +153,8 @@ void CVAAmbientMixerAudioRenderer::HandleProcessStream( ITADatasourceRealization
}
}
if( m_bSamplerActivated && m_pSampler )
// Mix sound sampler output
if( m_bSamplerEnabled && m_pSampler )
{
// Add samples to out buffer
for( unsigned int n = 0; n < m_pSampler->GetNumberOfChannels(); n++ )
......@@ -169,6 +169,8 @@ void CVAAmbientMixerAudioRenderer::HandleProcessStream( ITADatasourceRealization
double dSampleRate = m_pSampler->GetSampleRate();
assert( dSampleRate );
oSamplerStreamInfo.dStreamTimeCode = ( double ) ( oSamplerStreamInfo.nSamples ) / dSampleRate;
m_pSampler->IncrementBlockPointer();
}
m_pDataSource->IncrementWritePointer();
......@@ -200,28 +202,55 @@ void CVAAmbientMixerAudioRenderer::UpdateScene( CVASceneState* pNewState )
m_pNewSceneState = pNewState;
}
void CVAAmbientMixerAudioRenderer::SetParameters( const CVAStruct& )
void CVAAmbientMixerAudioRenderer::SetParameters( const CVAStruct& oInArgs )
{
if( oInArgs.HasKey( "Sampler" ) )
{
const CVAStruct& oSamplerUpdate( oInArgs[ "Sampler" ] );
int iTrack = 0; // First track
if( oSamplerUpdate.HasKey( "NewTrack" ) )
{
iTrack = m_pSampler->AddTrack( oSamplerUpdate[ "NewTrack" ] );
}
if( oSamplerUpdate.HasKey( "SampleFilePath" ) )
{
std::string sFilePathRaw = oSamplerUpdate[ "SampleFilePath" ];
std::string sFilePath = m_oParams.pCore->FindFilePath( sFilePathRaw );
int iNewSampleID = m_pSampler->LoadSample( sFilePath );
int iSampleCount = 0; // Immediate playback
m_pSampler->AddPlaybackBySamplecount( iNewSampleID, iTrack, iSampleCount );
}
}
}
CVAStruct CVAAmbientMixerAudioRenderer::GetParameters( const CVAStruct& oInArgs ) const
{
if( oInArgs.IsEmpty() )
return GetInfo();
CVAStruct oParameters;
oParameters[ "SamplerEnabled" ] = m_bSamplerEnabled;
oParameters[ "SignalSourceMixingEnabled" ] = m_bSignalSourceMixingEnabled;
oParameters[ "InitParams" ] = *( m_oParams.pConfig );
VA_EXCEPT_NOT_IMPLEMENTED;
if( m_pSampler )
{
CVAStruct oSamplerInfo;
oSamplerInfo[ "NumChannels" ] = ( int ) m_pSampler->GetNumberOfChannels();
oSamplerInfo[ "SamplingRate" ] = m_pSampler->GetSampleRate();
oSamplerInfo[ "BlockLength" ] = ( int ) m_pSampler->GetBlocklength();
oSamplerInfo[ "SampleCount" ] = m_pSampler->GetSampleCount();
return CVAStruct();
}
oParameters[ "Sampler" ] = oSamplerInfo;
}
CVAStruct CVAAmbientMixerAudioRenderer::GetInfo() const
{
CVAStruct s;
s[ "AmbientSamplerActivated" ] = m_bSamplerActivated;
s[ "SignalSourceMixingActivated" ] = m_bSignalSourceMixingActivated;
if( oInArgs.HasKey( "help" ) || oInArgs.HasKey( "doc" ) || oInArgs.HasKey( "info" ) )
{
CVAStruct oHelpSampler;
oHelpSampler[ "AddTrack" ] = "To add a new sample, use ...";
CVAStruct oHelp;
oHelp[ "Sampler" ] = oHelpSampler;
}
return s;
return oParameters;
}
#endif // VACORE_WITH_RENDERER_AMBIENT_MIXER
......@@ -69,8 +69,8 @@ private:
ITASoundSampler* m_pSampler; //!< Multi-channel multi-track ambient sound sampler
ITAStreamInfo oSamplerStreamInfo; //!< Stream info
bool m_bSamplerActivated; //!< Flag for activated sampler in config
bool m_bSignalSourceMixingActivated; //!< Flag for activated signal mixing in config
bool m_bSamplerEnabled; //!< Flag for activated sampler in config
bool m_bSignalSourceMixingEnabled; //!< Flag for activated signal mixing in config
CVASceneState* m_pNewSceneState;
CVASceneState* m_pCurSceneState;
......
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