Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
VACore
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
VACore
Commits
a206476d
Commit
a206476d
authored
Feb 27, 2018
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Plain Diff
Finalizing merge for offline simulation feature
parents
2e7826d0
435ff750
Changes
20
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
537 additions
and
135 deletions
+537
-135
CMakeLists.txt
CMakeLists.txt
+8
-4
src/Audiosignals/VAAudioSignalSourceManager.cpp
src/Audiosignals/VAAudioSignalSourceManager.cpp
+1
-3
src/Drivers/Audio/VAAudioDriverConfig.cpp
src/Drivers/Audio/VAAudioDriverConfig.cpp
+5
-6
src/Drivers/Audio/VAVirtualAudioDriverBackend.cpp
src/Drivers/Audio/VAVirtualAudioDriverBackend.cpp
+146
-0
src/Drivers/Audio/VAVirtualAudioDriverBackend.h
src/Drivers/Audio/VAVirtualAudioDriverBackend.h
+26
-6
src/Drivers/Audio/_SourceFiles.cmake
src/Drivers/Audio/_SourceFiles.cmake
+2
-2
src/Rendering/Ambisonics/Freefield/VAAmbisonicsFreefieldAudioRenderer.cpp
...bisonics/Freefield/VAAmbisonicsFreefieldAudioRenderer.cpp
+1
-1
src/Rendering/Binaural/AirTrafficNoise/VAAirTrafficNoiseAudioRenderer.cpp
...naural/AirTrafficNoise/VAAirTrafficNoiseAudioRenderer.cpp
+1
-1
src/Rendering/Binaural/ArtificialReverb/VABinauralArtificialReverb.cpp
.../Binaural/ArtificialReverb/VABinauralArtificialReverb.cpp
+1
-1
src/Rendering/Binaural/FreeField/VABinauralFreeFieldAudioRenderer.cpp
...g/Binaural/FreeField/VABinauralFreeFieldAudioRenderer.cpp
+16
-4
src/Rendering/Binaural/FreeField/VABinauralFreefieldAudioRenderer.h
...ing/Binaural/FreeField/VABinauralFreefieldAudioRenderer.h
+2
-0
src/Rendering/Prototyping/FreeField/VAPrototypeFreeFieldAudioRenderer.cpp
...ototyping/FreeField/VAPrototypeFreeFieldAudioRenderer.cpp
+1
-1
src/Rendering/Prototyping/GenericPath/VAPTGenericPathAudioRenderer.cpp
.../Prototyping/GenericPath/VAPTGenericPathAudioRenderer.cpp
+120
-94
src/Rendering/Prototyping/GenericPath/VAPTGenericPathAudioRenderer.h
...ng/Prototyping/GenericPath/VAPTGenericPathAudioRenderer.h
+2
-1
src/Rendering/Prototyping/HearingAid/VAPTHearingAidRenderer.cpp
...ndering/Prototyping/HearingAid/VAPTHearingAidRenderer.cpp
+1
-1
src/Rendering/VAAudioRenderer.h
src/Rendering/VAAudioRenderer.h
+1
-0
src/VACoreImpl.cpp
src/VACoreImpl.cpp
+25
-7
tests/CMakeLists.txt
tests/CMakeLists.txt
+11
-1
tests/CoreTest.cpp
tests/CoreTest.cpp
+2
-2
tests/OfflineSimulationVirtualDeviceTest.cpp
tests/OfflineSimulationVirtualDeviceTest.cpp
+165
-0
No files found.
CMakeLists.txt
View file @
a206476d
...
...
@@ -57,6 +57,10 @@ vista_use_package( Eigen REQUIRED )
# Optional packages
vista_find_package
(
RavenNet QUIET
)
if
(
ITA_VA_CORE_LIBS_FFT_USES_FFTW3
)
set
(
ITA_VA_COPYING_GNU_GPL ON PARENT_SCOPE
)
endif
(
)
if
(
NOT DEFINED ITA_VACORE_VERSION_MAJOR
)
set
(
ITA_VACORE_VERSION_MAJOR
"v2018"
CACHE STRING
"VACore version major (usually 'v' and year)"
)
endif
(
)
...
...
@@ -116,8 +120,8 @@ endif( )
if
(
NOT DEFINED ITA_VACORE_WITH_AUDIO_BACKEND_PORTAUDIO
)
set
(
ITA_VACORE_WITH_AUDIO_BACKEND_PORTAUDIO ON CACHE BOOL
"Build VACore with Portaudio audio backend support"
)
endif
(
)
if
(
NOT DEFINED ITA_VACORE_WITH_AUDIO_BACKEND_
DUMMY
)
set
(
ITA_VACORE_WITH_AUDIO_BACKEND_
DUMMY OFF CACHE BOOL
"Build VACore with dummy audio backend support
"
)
if
(
NOT DEFINED ITA_VACORE_WITH_AUDIO_BACKEND_
VIRTUAL
)
set
(
ITA_VACORE_WITH_AUDIO_BACKEND_
VIRTUAL OFF CACHE BOOL
"Build VACore with virtual audio backend support (for offline simulations)
"
)
endif
(
)
...
...
@@ -254,8 +258,8 @@ endif( )
if
(
ITA_VACORE_WITH_AUDIO_BACKEND_PORTAUDIO
)
add_definitions
(
-DVACORE_WITH_AUDIO_BACKEND_PORTAUDIO
)
endif
(
)
if
(
ITA_VACORE_WITH_AUDIO_BACKEND_
DUMMY
)
add_definitions
(
-DVACORE_WITH_AUDIO_BACKEND_
DUMMY
)
if
(
ITA_VACORE_WITH_AUDIO_BACKEND_
VIRTUAL
)
add_definitions
(
-DVACORE_WITH_AUDIO_BACKEND_
VIRTUAL
)
endif
(
)
# Rendering definitions
...
...
src/Audiosignals/VAAudioSignalSourceManager.cpp
View file @
a206476d
...
...
@@ -36,9 +36,7 @@
#include <sstream>
CVAAudioSignalSourceManager
::
CVAAudioSignalSourceManager
(
CVACoreImpl
*
pParentCore
,
const
CVAAudioDriverConfig
&
oAudioDriverConfig
,
ITADatasource
*
pDeviceInputSource
)
CVAAudioSignalSourceManager
::
CVAAudioSignalSourceManager
(
CVACoreImpl
*
pParentCore
,
const
CVAAudioDriverConfig
&
oAudioDriverConfig
,
ITADatasource
*
pDeviceInputSource
)
:
m_pParentCore
(
pParentCore
),
m_dSamplerate
(
oAudioDriverConfig
.
dSampleRate
),
m_iBlocklength
(
oAudioDriverConfig
.
iBuffersize
),
...
...
src/Drivers/Audio/VAAudioDriverConfig.cpp
View file @
a206476d
...
...
@@ -35,8 +35,8 @@ void CVAAudioDriverConfig::Init( const CVAStruct& oArgs )
CVAConfigInterpreter
conf
(
oArgs
);
conf
.
OptNonEmptyString
(
"Driver"
,
sDriver
);
conf
.
OptString
(
"Device"
,
sDevice
,
"AUTO"
);
conf
.
OptNumber
(
"Sample
r
ate"
,
dSampleRate
,
DEFAULT_SAMPLERATE
);
conf
.
OptInteger
(
"Buffer
s
ize"
,
iBuffersize
,
AUTO
,
&
lits
);
conf
.
OptNumber
(
"Sample
R
ate"
,
dSampleRate
,
DEFAULT_SAMPLERATE
);
conf
.
OptInteger
(
"Buffer
S
ize"
,
iBuffersize
,
AUTO
,
&
lits
);
conf
.
OptInteger
(
"InputChannels"
,
iInputChannels
,
AUTO
,
&
lits
);
conf
.
OptInteger
(
"OutputChannels"
,
iOutputChannels
,
AUTO
,
&
lits
);
...
...
@@ -48,9 +48,8 @@ void CVAAudioDriverConfig::Init( const CVAStruct& oArgs )
VA_EXCEPT1
(
"Invalid buffersize specified"
);
if
(
(
iInputChannels
<
0
)
&&
(
iInputChannels
!=
AUTO
)
)
VA_EXCEPT1
(
"Invalid number of input channels specified"
);
VA_EXCEPT1
(
"Invalid number of input channels specified
(autodetect = -1 or AUTO)
"
);
// @todo: really?! I don't see a point why single channel output shouldn't be supported.
if
(
(
iOutputChannels
<
2
)
&&
(
iOutputChannels
!=
AUTO
)
)
VA_EXCEPT1
(
"Invalid number of output channels specified (at least two)"
);
if
(
(
iOutputChannels
<
1
)
&&
(
iOutputChannels
!=
AUTO
)
)
VA_EXCEPT1
(
"Invalid number of output channels specified (at least one required, if not using autodetect ... -1 or AUTO)"
);
}
src/Drivers/Audio/VA
Dummy
AudioDriverBackend.cpp
→
src/Drivers/Audio/VA
Virtual
AudioDriverBackend.cpp
View file @
a206476d
#include "VA
Dummy
AudioDriverBackend.h"
#include "VA
Virtual
AudioDriverBackend.h"
#include "../../Utils/VADebug.h"
#include <VAException.h>
#include <ITAException.h>
#include <ITANumericUtils.h>
...
...
@@ -8,8 +9,8 @@
#include <cassert>
CVA
DummyAudioDriverBackend
::
CVADummy
AudioDriverBackend
(
const
CVAAudioDriverConfig
*
pConfig
)
:
CVAObject
(
"VirtualAudioD
river
"
)
CVA
VirtualAudioDriverBackend
::
CVAVirtual
AudioDriverBackend
(
const
CVAAudioDriverConfig
*
pConfig
)
:
CVAObject
(
"VirtualAudioD
evice
"
)
,
m_oConfig
(
*
pConfig
)
,
m_pDataSource
(
NULL
)
,
m_bStarted
(
false
)
...
...
@@ -19,72 +20,77 @@ CVADummyAudioDriverBackend::CVADummyAudioDriverBackend( const CVAAudioDriverConf
m_oOutputStreamProps
.
uiBlocklength
=
(
unsigned
int
)
m_oConfig
.
iBuffersize
;
}
CVA
DummyAudioDriverBackend
::~
CVADummy
AudioDriverBackend
()
CVA
VirtualAudioDriverBackend
::~
CVAVirtual
AudioDriverBackend
()
{
}
std
::
string
CVA
Dummy
AudioDriverBackend
::
getDriverName
()
const
std
::
string
CVA
Virtual
AudioDriverBackend
::
getDriverName
()
const
{
return
"
Dummy
"
;
return
"
Virtual
"
;
}
std
::
string
CVA
Dummy
AudioDriverBackend
::
getDeviceName
()
const
std
::
string
CVA
Virtual
AudioDriverBackend
::
getDeviceName
()
const
{
return
"
Dummy
"
;
return
"
Trigger
"
;
}
int
CVA
Dummy
AudioDriverBackend
::
getNumberOfInputs
()
const
int
CVA
Virtual
AudioDriverBackend
::
getNumberOfInputs
()
const
{
return
m_oConfig
.
iInputChannels
;
}
const
ITAStreamProperties
*
CVA
Dummy
AudioDriverBackend
::
getOutputStreamProperties
()
const
const
ITAStreamProperties
*
CVA
Virtual
AudioDriverBackend
::
getOutputStreamProperties
()
const
{
return
&
m_oOutputStreamProps
;
}
void
CVA
Dummy
AudioDriverBackend
::
setOutputStreamDatasource
(
ITADatasource
*
pDatasource
)
void
CVA
Virtual
AudioDriverBackend
::
setOutputStreamDatasource
(
ITADatasource
*
pDatasource
)
{
m_pDataSource
=
pDatasource
;
}
ITADatasource
*
CVA
Dummy
AudioDriverBackend
::
getInputStreamDatasource
()
const
ITADatasource
*
CVA
Virtual
AudioDriverBackend
::
getInputStreamDatasource
()
const
{
return
nullptr
;
}
void
CVA
Dummy
AudioDriverBackend
::
initialize
()
void
CVA
Virtual
AudioDriverBackend
::
initialize
()
{
}
void
CVA
Dummy
AudioDriverBackend
::
finalize
()
void
CVA
Virtual
AudioDriverBackend
::
finalize
()
{
}
void
CVA
Dummy
AudioDriverBackend
::
startStreaming
()
void
CVA
Virtual
AudioDriverBackend
::
startStreaming
()
{
m_bStarted
=
true
;
}
bool
CVA
Dummy
AudioDriverBackend
::
isStreaming
()
bool
CVA
Virtual
AudioDriverBackend
::
isStreaming
()
{
return
m_bStarted
;
}
void
CVA
Dummy
AudioDriverBackend
::
stopStreaming
()
void
CVA
Virtual
AudioDriverBackend
::
stopStreaming
()
{
m_bStarted
=
false
;
}
CVAStruct
CVA
Dummy
AudioDriverBackend
::
CallObject
(
const
CVAStruct
&
oArgs
)
CVAStruct
CVA
Virtual
AudioDriverBackend
::
CallObject
(
const
CVAStruct
&
oArgs
)
{
CVAStruct
oReturn
;
if
(
oArgs
.
HasKey
(
"trigger"
)
&&
m_pDataSource
)
{
// Trigger block pointer getter, then increment
for
(
int
n
=
0
;
n
<
(
int
)
m_pDataSource
->
GetNumberOfChannels
();
n
++
)
m_pDataSource
->
GetBlockPointer
(
n
,
&
m_oStreamInfo
);
m_pDataSource
->
IncrementBlockPointer
();
}
if
(
oArgs
.
HasKey
(
"help"
)
||
oArgs
.
HasKey
(
"info"
)
)
{
...
...
@@ -93,3 +99,48 @@ CVAStruct CVADummyAudioDriverBackend::CallObject( const CVAStruct& oArgs )
return
oReturn
;
}
CVAVirtualAudioDriverBackend
::
ManualClock
::
ManualClock
()
:
CVAObject
(
"ManualClock"
)
,
m_dTime
(
0.0
f
)
{
}
CVAVirtualAudioDriverBackend
::
ManualClock
::~
ManualClock
()
{
}
double
CVAVirtualAudioDriverBackend
::
ManualClock
::
getTime
()
{
m_csTime
.
enter
();
double
dTime
=
m_dTime
;
m_csTime
.
leave
();
return
dTime
;
}
void
CVAVirtualAudioDriverBackend
::
ManualClock
::
SetTime
(
double
dNow
)
{
m_csTime
.
enter
();
assert
(
m_dTime
<
dNow
);
m_dTime
=
dNow
;
m_csTime
.
leave
();
}
CVAStruct
CVAVirtualAudioDriverBackend
::
ManualClock
::
CallObject
(
const
CVAStruct
&
oArgs
)
{
if
(
oArgs
.
HasKey
(
"info"
)
||
oArgs
.
HasKey
(
"help"
)
)
{
CVAStruct
oRet
;
oRet
[
"usage"
]
=
"Set the manual clock with the key 'time' and a floating point value. Time has to be strict monotonously increasing"
;
return
oRet
;
}
else
if
(
oArgs
.
HasKey
(
"time"
)
)
{
SetTime
(
oArgs
[
"time"
]
);
return
CVAStruct
();
}
else
{
VA_EXCEPT2
(
INVALID_PARAMETER
,
"Could npt understand call, 'time' key missing. use 'help' for more information"
);
}
}
src/Drivers/Audio/VA
Dummy
AudioDriverBackend.h
→
src/Drivers/Audio/VA
Virtual
AudioDriverBackend.h
View file @
a206476d
...
...
@@ -11,8 +11,8 @@
* --------------------------------------------------------------------------------------------
*/
#ifndef IW_VACORE_
DUMMY
_AUDIO_DRIVER_BACKEND
#define IW_VACORE_
DUMMY
_AUDIO_DRIVER_BACKEND
#ifndef IW_VACORE_
VIRTUAL
_AUDIO_DRIVER_BACKEND
#define IW_VACORE_
VIRTUAL
_AUDIO_DRIVER_BACKEND
#include "VAAudioDriverBackend.h"
#include "VAAudioDriverConfig.h"
...
...
@@ -21,14 +21,17 @@
#include <ITAStreamProperties.h>
#include <ITADatasource.h>
#include <ITACriticalSection.h>
#include <ITAClock.h>
#include <ITAStreamInfo.h>
#pragma warning( disable : 4512 ) // yep no copy constructor
class
CVA
Dummy
AudioDriverBackend
:
public
IVAAudioDriverBackend
,
public
CVAObject
class
CVA
Virtual
AudioDriverBackend
:
public
IVAAudioDriverBackend
,
public
CVAObject
{
public:
CVA
Dummy
AudioDriverBackend
(
const
CVAAudioDriverConfig
*
pConfig
);
~
CVA
Dummy
AudioDriverBackend
();
CVA
Virtual
AudioDriverBackend
(
const
CVAAudioDriverConfig
*
pConfig
);
~
CVA
Virtual
AudioDriverBackend
();
std
::
string
getDriverName
()
const
;
std
::
string
getDeviceName
()
const
;
...
...
@@ -45,11 +48,28 @@ public:
CVAStruct
CallObject
(
const
CVAStruct
&
oArgs
);
class
ManualClock
:
public
ITAClock
,
public
CVAObject
{
public:
ManualClock
();
~
ManualClock
();
inline
std
::
string
getName
()
const
{
return
"ManualClock"
;
};
inline
double
getResolution
()
const
{
return
-
1.0
f
;
};
double
getFrequency
()
const
{
return
-
1.0
f
;
};
inline
double
getTime
();
inline
void
SetTime
(
const
double
dManualNow
);
CVAStruct
CallObject
(
const
CVAStruct
&
oArgs
);
private:
ITACriticalSection
m_csTime
;
double
m_dTime
;
};
private:
const
CVAAudioDriverConfig
m_oConfig
;
ITAStreamProperties
m_oOutputStreamProps
;
ITAStreamInfo
m_oStreamInfo
;
ITADatasource
*
m_pDataSource
;
bool
m_bStarted
;
};
#endif // IW_VACORE_
DUMMY
_AUDIO_DRIVER_BACKEND
#endif // IW_VACORE_
VIRTUAL
_AUDIO_DRIVER_BACKEND
src/Drivers/Audio/_SourceFiles.cmake
View file @
a206476d
...
...
@@ -17,8 +17,8 @@ endif( )
if
(
ITA_VACORE_WITH_AUDIO_BACKEND_PORTAUDIO
)
list
(
APPEND DirFiles VAPortaudioBackend.cpp VAPortaudioBackend.h
)
endif
(
)
if
(
ITA_VACORE_WITH_AUDIO_BACKEND_
DUMMY
)
list
(
APPEND DirFiles VA
DummyAudioDriverBackend.cpp VADummy
AudioDriverBackend.h
)
if
(
ITA_VACORE_WITH_AUDIO_BACKEND_
VIRTUAL
)
list
(
APPEND DirFiles VA
VirtualAudioDriverBackend.cpp VAVirtual
AudioDriverBackend.h
)
endif
(
)
set
(
DirFiles_SourceGroup
"
${
RelativeSourceGroup
}
"
)
...
...
src/Rendering/Ambisonics/Freefield/VAAmbisonicsFreefieldAudioRenderer.cpp
View file @
a206476d
...
...
@@ -334,7 +334,7 @@ void CVAAmbisonicsFreeFieldAudioRenderer::Reset()
VA_VERBOSE
(
"AmbisonicsFreeFieldAudioRenderer"
,
"Received reset call, indicating reset now"
);
ctxAudio
.
m_iResetFlag
=
1
;
// Request reset
if
(
ctxAudio
.
m_iStatus
==
0
)
if
(
ctxAudio
.
m_iStatus
==
0
||
m_oParams
.
bOfflineRendering
)
{
VA_VERBOSE
(
"AmbisonicsFreeFieldAudioRenderer"
,
"Was not streaming, will reset manually"
);
// if no streaming active, reset manually
...
...
src/Rendering/Binaural/AirTrafficNoise/VAAirTrafficNoiseAudioRenderer.cpp
View file @
a206476d
...
...
@@ -410,7 +410,7 @@ void CVABinauralAirTrafficNoiseAudioRenderer::Reset()
{
ctxAudio
.
m_iResetFlag
=
1
;
// Request reset
if
(
ctxAudio
.
m_iStatus
==
0
)
if
(
ctxAudio
.
m_iStatus
==
0
||
m_oParams
.
bOfflineRendering
)
{
// if no streaming active, reset manually
//SyncInternalData();
...
...
src/Rendering/Binaural/ArtificialReverb/VABinauralArtificialReverb.cpp
View file @
a206476d
...
...
@@ -491,7 +491,7 @@ void CVABinauralArtificialReverbAudioRenderer::Reset()
{
ctxAudio
.
m_iResetFlag
=
1
;
// Request reset
if
(
ctxAudio
.
m_iStatus
==
0
)
if
(
ctxAudio
.
m_iStatus
==
0
||
m_oParams
.
bOfflineRendering
)
{
// if no streaming active, reset manually
ResetInternalData
();
...
...
src/Rendering/Binaural/FreeField/VABinauralFreeFieldAudioRenderer.cpp
View file @
a206476d
...
...
@@ -188,19 +188,20 @@ private:
friend
class
CVABFFSoundPathFactory
;
};
class
CVABFFSoundPathFactory
:
public
IVAPoolObjectFactory
{
class
CVABFFSoundPathFactory
:
public
IVAPoolObjectFactory
{
public:
CVABFFSoundPathFactory
(
double
dSamplerate
,
int
iBlocklength
,
int
iHRIRFilterLength
,
int
iDirFilterLength
)
:
m_dSamplerate
(
dSamplerate
)
,
m_iBlocklength
(
iBlocklength
)
,
m_iHRIRFilterLength
(
iHRIRFilterLength
)
,
m_iDirFilterLength
(
iDirFilterLength
)
{}
{}
;
CVAPoolObject
*
CreatePoolObject
()
{
return
new
CVABFFSoundPath
(
m_dSamplerate
,
m_iBlocklength
,
m_iHRIRFilterLength
,
m_iDirFilterLength
);
}
}
;
private:
double
m_dSamplerate
;
//!< Abtastrate
...
...
@@ -362,7 +363,7 @@ void CVABinauralFreeFieldAudioRenderer::Reset()
VA_VERBOSE
(
"BinauralFreeFieldAudioRenderer"
,
"Received reset call, indicating reset now"
);
ctxAudio
.
m_iResetFlag
=
1
;
// Request reset
if
(
ctxAudio
.
m_iStatus
==
0
)
if
(
ctxAudio
.
m_iStatus
==
0
||
m_oParams
.
bOfflineRendering
)
{
VA_VERBOSE
(
"BinauralFreeFieldAudioRenderer"
,
"Was not streaming, will reset manually"
);
// if no streaming active, reset manually
...
...
@@ -1391,6 +1392,17 @@ CVAStruct CVABinauralFreeFieldAudioRenderer::CallObject( const CVAStruct& oArgs
VA_EXCEPT2
(
INVALID_PARAMETER
,
"Invalid command (
\"
"
+
sCommandOrg
+
"
\"
)"
);
}
void
CVABinauralFreeFieldAudioRenderer
::
SetParameters
(
const
CVAStruct
&
oParams
)
{
// Only delegate
CallObject
(
oParams
);
}
CVAStruct
CVABinauralFreeFieldAudioRenderer
::
GetParameters
(
const
CVAStruct
&
)
{
return
CVAStruct
(
*
m_oParams
.
pConfig
);
}
void
CVABinauralFreeFieldAudioRenderer
::
onStartDumpListeners
(
const
std
::
string
&
sFilenameFormat
)
{
if
(
m_bDumpListeners
)
...
...
src/Rendering/Binaural/FreeField/VABinauralFreefieldAudioRenderer.h
View file @
a206476d
...
...
@@ -118,6 +118,8 @@ public:
// --= Module interface =--
CVAStruct
CallObject
(
const
CVAStruct
&
oArgs
);
void
SetParameters
(
const
CVAStruct
&
oParams
);
CVAStruct
GetParameters
(
const
CVAStruct
&
);
void
onStartDumpListeners
(
const
std
::
string
&
sFilenameFormat
);
void
onStopDumpListeners
();
...
...
src/Rendering/Prototyping/FreeField/VAPrototypeFreeFieldAudioRenderer.cpp
View file @
a206476d
...
...
@@ -370,7 +370,7 @@ void CVAPrototypeFreeFieldAudioRenderer::Reset()
VA_VERBOSE
(
"PrototypeFreeFieldAudioRenderer"
,
"Received reset call, indicating reset now"
);
ctxAudio
.
m_iResetFlag
=
1
;
// Request reset
if
(
ctxAudio
.
m_iStatus
==
0
)
if
(
ctxAudio
.
m_iStatus
==
0
||
m_oParams
.
bOfflineRendering
)
{
VA_VERBOSE
(
"PrototypeFreeFieldAudioRenderer"
,
"Was not streaming, will reset manually"
);
// if no streaming active, reset manually
...
...
src/Rendering/Prototyping/GenericPath/VAPTGenericPathAudioRenderer.cpp
View file @
a206476d
This diff is collapsed.
Click to expand it.
src/Rendering/Prototyping/GenericPath/VAPTGenericPathAudioRenderer.h
View file @
a206476d
...
...
@@ -120,9 +120,9 @@ private:
int
m_iIRFilterLengthSamples
;
//!< Length of the HRIR filter DSP module
int
m_iNumChannels
;
//!< Number of channels per sound path
int
m_iFilterDelaySamples
;
//!< Filter delay in samples
bool
m_bOutputMonitoring
;
//!< Shows output infos / warnings if the overall listener output is zero (no filter loaded)
ITADatasourceRealization
*
m_pOutput
;
ITASampleBuffer
m_sfTempBuffer
;
class
CVAPTGPUpdateMessage
:
public
CVAPoolObject
{
...
...
@@ -179,6 +179,7 @@ private:
void
UpdateGenericSoundPath
(
int
iListenerID
,
int
iSourceID
,
int
iChannel
,
const
std
::
string
&
sIRFilePath
);
void
UpdateGenericSoundPath
(
int
iListenerID
,
int
iSourceID
,
ITASampleFrame
&
sfIR
);
void
UpdateGenericSoundPath
(
int
iListenerID
,
int
iSourceID
,
int
iChannel
,
ITASampleBuffer
&
sbIR
);
void
UpdateGenericSoundPath
(
const
int
iListenerID
,
const
int
iSourceID
,
const
double
dDelaySeconds
);
friend
class
CVAPTGenericSoundPath
;
friend
class
CVAPTGPListenerPoolFactory
;
...
...
src/Rendering/Prototyping/HearingAid/VAPTHearingAidRenderer.cpp
View file @
a206476d
...
...
@@ -405,7 +405,7 @@ void CVAPTHearingAidRenderer::Reset()
{
ctxAudio
.
m_iResetFlag
=
1
;
// Request reset
if
(
ctxAudio
.
m_iStatus
==
0
)
if
(
ctxAudio
.
m_iStatus
==
0
||
m_oParams
.
bOfflineRendering
)
{
// if no streaming active, reset manually
//SyncInternalData();
...
...
src/Rendering/VAAudioRenderer.h
View file @
a206476d
...
...
@@ -39,6 +39,7 @@ public:
bool
bRecordOutputEnabled
;
//!< Renderer output recording and storing flag
std
::
string
sRecordOutputFilePath
;
//!< Renderer output recording and storing file path
bool
bOutputLevelMeterEnabled
;
//!< Renderer output level meter will be used (uses a little bit CPU resources)
bool
bOfflineRendering
;
//!< Offline rendering indicator (using a virtual audio device and external trigger)
};
//! Audio renderer interface
...
...
src/VACoreImpl.cpp
View file @
a206476d
...
...
@@ -49,8 +49,8 @@
#ifdef VACORE_WITH_AUDIO_BACKEND_PORTAUDIO
#include "Drivers/Audio/VAPortaudioBackend.h"
#endif
#ifdef VACORE_WITH_AUDIO_BACKEND_
DUMMY
#include "Drivers/Audio/VA
Dummy
AudioDriverBackend.h"
#ifdef VACORE_WITH_AUDIO_BACKEND_
VIRTUAL
#include "Drivers/Audio/VA
Virtual
AudioDriverBackend.h"
#endif
// ITA includes
...
...
@@ -494,6 +494,7 @@ void CVACoreImpl::Initialize() {
SetProgress
(
"Setting up resource managers"
,
""
,
2
);
assert
(
m_oCoreConfig
.
oAudioDriverConfig
.
iInputChannels
>=
0
);
m_pSignalSourceManager
=
new
CVAAudioSignalSourceManager
(
this
,
m_oCoreConfig
.
oAudioDriverConfig
,
pInputTail
);
m_pGlobalSamplePool
=
ITASoundSamplePool
::
Create
(
1
,
m_oCoreConfig
.
oAudioDriverConfig
.
dSampleRate
);
m_pGlobalSampler
=
ITASoundSampler
::
Create
(
1
,
m_oCoreConfig
.
oAudioDriverConfig
.
dSampleRate
,
m_oCoreConfig
.
oAudioDriverConfig
.
iBuffersize
,
m_pGlobalSamplePool
);
...
...
@@ -761,7 +762,8 @@ void CVACoreImpl::Finalize()
VA_TRY
{
// Mehrfaches Finialisieren fhrt nicht zu Fehlern
if
(
m_iState
==
VA_CORESTATE_CREATED
)
return
;
if
(
m_iState
==
VA_CORESTATE_CREATED
)
return
;
if
(
m_iState
==
VA_CORESTATE_FAIL
)
VA_EXCEPT2
(
MODAL_ERROR
,
"Core corrupted, finalization impossible"
);
...
...
@@ -4327,17 +4329,32 @@ void CVACoreImpl::InitializeAudioDriver()
if
(
m_oCoreConfig
.
oAudioDriverConfig
.
sDriver
==
"Portaudio"
)
m_pAudioDriverBackend
=
new
CVAPortaudioBackend
(
&
m_oCoreConfig
.
oAudioDriverConfig
);
#endif
#ifdef VACORE_WITH_AUDIO_BACKEND_
DUMMY
if
(
m_oCoreConfig
.
oAudioDriverConfig
.
sDriver
==
"
Dummy
"
)
#ifdef VACORE_WITH_AUDIO_BACKEND_
VIRTUAL
if
(
m_oCoreConfig
.
oAudioDriverConfig
.
sDriver
==
"
Virtual
"
)
{
CVADummyAudioDriverBackend
*
pAudioDriverBackend
=
new
CVADummyAudioDriverBackend
(
&
m_oCoreConfig
.
oAudioDriverConfig
);
if
(
m_oCoreConfig
.
oAudioDriverConfig
.
iBuffersize
==
-
1
)
VA_EXCEPT2
(
INVALID_PARAMETER
,
"For a virtual audio device, the buffer size has to be set (AUTO detect not possible)"
);
if
(
m_oCoreConfig
.
oAudioDriverConfig
.
iOutputChannels
==
-
1
)
VA_EXCEPT2
(
INVALID_PARAMETER
,
"For a virtual audio device, the output channel number has to be set (AUTO detect not possible)"
);
m_oCoreConfig
.
oAudioDriverConfig
.
iInputChannels
=
0
;
// not allowed, override
CVAVirtualAudioDriverBackend
*
pAudioDriverBackend
=
new
CVAVirtualAudioDriverBackend
(
&
m_oCoreConfig
.
oAudioDriverConfig
);
RegisterModule
(
pAudioDriverBackend
);
m_pAudioDriverBackend
=
pAudioDriverBackend
;
// Overwride default block pointer by manual clock
CVAVirtualAudioDriverBackend
::
ManualClock
*
pManualClock
=
new
CVAVirtualAudioDriverBackend
::
ManualClock
();
RegisterModule
(
pManualClock
);
m_pClock
=
pManualClock
;
}
#else
#endif
if
(
m_pAudioDriverBackend
==
nullptr
)
VA_E
RROR
(
"Core"
,
"Unkown or unsupported audio driver backend '"
<<
m_oCoreConfig
.
oAudioDriverConfig
.
sDriver
<<
"'"
);
VA_E
XCEPT2
(
INVALID_PARAMETER
,
"Unkown, uninitializable or unsupported audio driver backend '"
+
m_oCoreConfig
.
oAudioDriverConfig
.
sDriver
+
"'"
);
try
{
...
...
@@ -4445,6 +4462,7 @@ void CVACoreImpl::InitializeAudioRenderers()
oParams
.
sClass
=
sClass
;
oParams
.
pCore
=
this
;
oParams
.
pConfig
=
&
cit
->
second
.
GetStruct
();
oParams
.
bOfflineRendering
=
(
m_oCoreConfig
.
oAudioDriverConfig
.
sDriver
==
"Virtual"
)
?
true
:
false
;
conf
.
ReqStringListRegex
(
"Reproductions"
,
oParams
.
vsReproductions
,
"
\\
s*,
\\
s*"
);
std
::
unique
(
oParams
.
vsReproductions
.
begin
(),
oParams
.
vsReproductions
.
end
()
);
...
...
tests/CMakeLists.txt
View file @
a206476d
...
...
@@ -61,4 +61,14 @@ vista_configure_app( NetworkStreamAudioSignalSourceTest )
vista_install
(
NetworkStreamAudioSignalSourceTest
)
vista_create_default_info_file
(
NetworkStreamAudioSignalSourceTest
)
set_property
(
TARGET NetworkStreamAudioSignalSourceTest PROPERTY FOLDER
"VA/Tests/VABase"
)
set_property
(
TARGET NetworkStreamAudioSignalSourceTest PROPERTY FOLDER
"VA/Tests/VACore"
)
add_executable
(
OfflineSimulationVirtualDeviceTest OfflineSimulationVirtualDeviceTest.cpp
)
target_link_libraries
(
OfflineSimulationVirtualDeviceTest
${
VISTA_USE_PACKAGE_LIBRARIES
}
${
VISTAINTERPROCCOMM_ADDITIONAL_DEPENDENCIES
}
)
vista_configure_app
(
OfflineSimulationVirtualDeviceTest
)
#vista_install( OfflineSimulationVirtualDeviceTest )
#vista_create_default_info_file( OfflineSimulationVirtualDeviceTest )
set_property
(
TARGET OfflineSimulationVirtualDeviceTest PROPERTY FOLDER
"VA/Tests/VACore"
)
tests/CoreTest.cpp
View file @
a206476d
...
...
@@ -132,13 +132,13 @@ CVAStruct GetCoreConfig()
CVAStruct
oRenderer1
;
oRenderer1
[
"class"
]
=
"BinauralFreeField"
;
oRenderer1
[
"
output
s"
]
=
"MyTalkthroughHeadphones"
;
oRenderer1
[
"
Reproduction
s"
]
=
"MyTalkthroughHeadphones"
;
oConfig
[
"Renderer:BFF_CoreTest"
]
=
oRenderer1
;
CVAStruct
oRenderer2
;
oRenderer2
[
"class"
]
=
"PrototypeGenericPath"
;
oRenderer2
[
"numchannels"
]
=
2
;
oRenderer2
[
"
output
s"
]
=
"MyTalkthroughHeadphones"
;
oRenderer2
[
"
Reproduction
s"
]
=
"MyTalkthroughHeadphones"
;
oConfig
[
"Renderer:PTGP_CoreTest"
]
=
oRenderer2
;
return
oConfig
;
...
...
tests/OfflineSimulationVirtualDeviceTest.cpp
0 → 100644
View file @
a206476d
#include <VA.h>
#include <VACore.h>
#include <iostream>
#include <VistaBase/VistaTimeUtils.h>
using
namespace
std
;
IVAInterface
*
pCore
=
NULL
;
const
int
g_iBlockLength
=
128
;
const
double
g_dSampleRate
=
44100.0
f
;
//! Trigger virtual audio device block increment in audio processing thread
/**
* A special prototype call to control the virtual audio device and increment a block
* of the audio processing by user. Produces one more block of audio samples and increments
* the pCore time by user-defined time steps.
*/
void
TriggerVirtualAudioDeviceBlockIncrement
();
//! Manually update the core clock
/**
* ... used for scene modification time stamps. This lets the user control the
* asynchronous update beaviour independent from the audio processing thread.
*/
void
ManualCoreClockUpdate
(
const
double
);
void
TestOfflineSimulationVirtualAudioDevice
()
{
// Load directivity
int
iHRTFID
=
pCore
->
CreateDirectivityFromFile
(
"ITA_Artificial_Head_5x5_44kHz_128.v17.ir.daff"
);
// Set up scene
int
iListenerID
=
pCore
->
CreateSoundReceiver
(
"Listener with HRTF"
);
pCore
->
SetSoundReceiverPosition
(
iListenerID
,
VAVec3
(
0
,
1.7
,
0
)
);
pCore
->
SetActiveSoundReceiver
(
iListenerID
);
pCore
->
SetSoundReceiverDirectivity
(
iListenerID
,
iHRTFID
);
int
iSourceID
=
pCore
->
CreateSoundSource
(
"Source"
);
// Load input data & start playback
string
sFileSignalID
=
pCore
->
CreateSignalSourceBufferFromFile
(
"WelcomeToVA.wav"
);
pCore
->
SetSignalSourceBufferPlaybackAction
(
sFileSignalID
,
IVAInterface
::
VA_PLAYBACK_ACTION_PLAY
);
pCore
->
SetSignalSourceBufferLooping
(
sFileSignalID
,
true
);
pCore
->
SetSoundSourceSignalSource
(
iSourceID
,
sFileSignalID
);
// --- Simulation loop using time steps and synchronized scene & audio updates --- //
const
int
iNumSteps
=
3445
;
// will produce 10 seconds of scene updates & audio processing