Commit 3e2ad198 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen

Merge branch 'develop' of https://git.rwth-aachen.de/ita/VACore into develop

parents 859868e8 27f7fd09
......@@ -182,7 +182,7 @@ SwitchingAlgorithm = cubicspline
Class = BinauralArtificialReverb
Enabled = false
Reproductions = MyTalkthroughHeadphones
ReverberationTime = 1, 0.71, 0.3
ReverberationTimes = 1, 0.71, 0.3
RoomVolume = 200
RoomSurfaceArea = 88
MaxReverbFilterLengthSamples = 88200
......@@ -340,12 +340,12 @@ Reproductions = MyTalkthroughHeadphones
# Each section has the format [Reproduction:<ID>] (<ID> must be unique and is freely chooseable).
# Warum diese Schicht mit Eingngen und Ausgngen?
#- Vernnftige Gruppierung fr Meters
#- Abstraktion der Renderer und Reproductions von physikalischen Kanlen
#- Zusatzfunktionalitt unbh. von Renderer und Reproductions: Equalization
# Warum diese Schicht mit Eingngen und Ausgngen?
#- Vernnftige Gruppierung fr Meters
#- Abstraktion der Renderer und Reproductions von physikalischen Kanlen
#- Zusatzfunktionalitt unbh. von Renderer und Reproductions: Equalization
#
#- Diese Inputs mssen als Signalquellen im Core erscheinen
#- Diese Inputs mssen als Signalquellen im Core erscheinen
[Reproduction:MyTalkthroughHeadphones]
......
......@@ -12,6 +12,7 @@ Devices = LS1, LS2, LS3, LS4, LS5, LS6, LS7, LS8, LS9, LS10, LS11, LS12, LS13, L
Type = LS
Channels = 1
Position = 0,1,-6.1232e-17
[OutputDevice:LS2]
Type = LS
......
......@@ -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();
......
......@@ -393,6 +393,9 @@ void CVAVBAPFreeFieldAudioRenderer::HandleProcessStream( ITADatasourceRealizatio
double dOverallGain = pState->GetVolume( m_oParams.pCore->GetCoreConfig()->dDefaultAmplitudeCalibration ); // Lautsrke der Quelle einstellen
dOverallGain /= vSoundSource.Length(); // 1/r Gesetz
// if (oPath->pSource->pData->bMuted || (bDSEnabled == false))
// fSoundSourceGain = 0.0f;
for( int k = 0; k < vdLoudspeakerGains.size(); k++ ) // anwenden
{
......
......@@ -116,7 +116,7 @@ void CVAAmbisonicsReproduction::SetInputDatasource( ITADatasource* p )
if( GetNumInputChannels() != int( p->GetNumberOfChannels() ) )
VA_WARN( "AmbisonicsReproduction", "Ambisonics order missmatch in renderer and reproduction modules, truncating higher orders" );
int iMaxPossibleAmbisonicsChannelNumber = (std::min)( int( p->GetNumberOfChannels() ), iNumConfiguredAmbisonicsChannels );
int iMaxPossibleAmbisonicsChannelNumber = std::min( int( p->GetNumberOfChannels() ), iNumConfiguredAmbisonicsChannels );
std::string sOutput;
conf.ReqString( "Outputs", sOutput );
......
......@@ -23,7 +23,6 @@
#include "Eigen\SVD"
#include "Eigen\Jacobi"
#include <atomic>
#include <ITASampleFrame.h>
class ITADatasource;
......@@ -35,13 +34,12 @@ class CVABasicMotionModel;
class CVAAmbisonicsBinauralMixdownReproduction : public IVAAudioReproduction
{
public:
CVAAmbisonicsBinauralMixdownReproduction( const CVAAudioReproductionInitParams& oParams );
CVAAmbisonicsBinauralMixdownReproduction(const CVAAudioReproductionInitParams& oParams);
~CVAAmbisonicsBinauralMixdownReproduction();
void SetInputDatasource( ITADatasource* );
void SetInputDatasource(ITADatasource*);
ITADatasource* GetOutputDatasource();
int GetNumInputChannels() const;
void SetParameters(const CVAStruct& oParams);
CVAStruct GetParameters(const CVAStruct&) const;
......@@ -55,18 +53,23 @@ public:
* Information on virtual position of listener is used
* for binaural downmix with related HRIR.
*/
void SetTrackedListener( const int iListenerID );
void SetTrackedListener(const int iListenerID);
Eigen::MatrixXd CalculatePseudoInverse(Eigen::MatrixXd);
void UpdateScene( CVASceneState* pNewState );
void GetCalculatedReproductionCenterPos(VAVec3 &vec3CalcPos);
private:
std::string m_sName;
CVAAudioReproductionInitParams m_oParams;
bool m_bBFormatIsInit;
int m_iHRIRFilterLength;
int m_iAmbisonicsTruncationOrder;
std::string m_sRotationMode;
Eigen::MatrixXd m_matYinv;
std::vector<double> m_vdRemaxWeights;
Eigen::MatrixXd m_orderMatrices[5];
VAVec3 m_v3ReproductionCenterPos;
std::atomic<double> m_dTrackingDelaySeconds;
std::vector< const CVAHardwareOutput* > m_vpTargetOutputs;
......@@ -85,6 +88,10 @@ private:
std::vector< int > m_viLastHRIRIndex;
};
#endif // VACORE_WITH_REPRODUCTION_AMBISONICS_BINAURAL_MIXDOWN
#endif // IW_VACORE_AMBISONICSBINAURALMIXDOWNREPRODUCTION
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