Commit 9ecef3f9 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Adding anthropometric parameter setter for listener, for individualized and/or...

Adding anthropometric parameter setter for listener, for individualized and/or generic binaural processing
parent 5d99a1d7
...@@ -11,6 +11,14 @@ public class VAUListener : MonoBehaviour { ...@@ -11,6 +11,14 @@ public class VAUListener : MonoBehaviour {
public int NumMaxReverbZones = 2; public int NumMaxReverbZones = 2;
public string VAAudioRenderer = "MyBinauralArtificialReverb"; public string VAAudioRenderer = "MyBinauralArtificialReverb";
public VAUHRIRDataset HRIR = null; public VAUHRIRDataset HRIR = null;
public double HeadWidth = 0.12; // Anthropometric data, for HRIR individualization or generic binaural cues
public double HeadHeight = 0.10; // Anthropometric data, for HRIR individualization or generic binaural cues
public double HeadDepth = 0.15; // Anthropometric data, for HRIR individualization or generic binaural cues
private double ShadowHeadWidth;
private double ShadowHeadHeight;
private double ShadowHeadDepth;
private int _ID; private int _ID;
private VANet _VA = null; private VANet _VA = null;
...@@ -41,6 +49,11 @@ public class VAUListener : MonoBehaviour { ...@@ -41,6 +49,11 @@ public class VAUListener : MonoBehaviour {
else if( VAUAdapter.DefaultHRIRID != -1 ) else if( VAUAdapter.DefaultHRIRID != -1 )
_VA.SetListenerHRIRDataset(_ID, VAUAdapter.DefaultHRIRID); _VA.SetListenerHRIRDataset(_ID, VAUAdapter.DefaultHRIRID);
_VA.SetListenerAnthropometricData(_ID, HeadWidth, HeadHeight, HeadDepth);
ShadowHeadWidth = HeadWidth;
ShadowHeadHeight = HeadHeight;
ShadowHeadDepth = HeadDepth;
SetListenerPositionOrientation(); SetListenerPositionOrientation();
_VA.SetArtificalReverbarationTime(VAAudioRenderer, 0.3f); _VA.SetArtificalReverbarationTime(VAAudioRenderer, 0.3f);
...@@ -57,9 +70,17 @@ public class VAUListener : MonoBehaviour { ...@@ -57,9 +70,17 @@ public class VAUListener : MonoBehaviour {
{ {
SetListenerPositionOrientation(); SetListenerPositionOrientation();
SetActiveReverbZones(); SetActiveReverbZones();
if( HeadWidth != ShadowHeadWidth || HeadHeight != ShadowHeadHeight || HeadDepth != ShadowHeadDepth )
{
_VA.SetListenerAnthropometricData(_ID, HeadWidth, HeadHeight, HeadDepth);
ShadowHeadWidth = HeadWidth;
ShadowHeadHeight = HeadHeight;
ShadowHeadDepth = HeadDepth;
}
} }
//uses the View- and Up-Vector to transmit the position of the listener to VA // Uses the View- and Up-Vector to transmit the position of the listener to VA
void SetListenerPositionOrientation() void SetListenerPositionOrientation()
{ {
_VA = VAUAdapter.VA; _VA = VAUAdapter.VA;
...@@ -124,7 +145,7 @@ public class VAUListener : MonoBehaviour { ...@@ -124,7 +145,7 @@ public class VAUListener : MonoBehaviour {
_VA.SetListenerAuralizationMode(_ID, AuraMode); _VA.SetListenerAuralizationMode(_ID, AuraMode);
} }
void OnDisable() private void OnDestroy()
{ {
if (GetComponent<VAUAuralizationMode>() != null) if (GetComponent<VAUAuralizationMode>() != null)
GetComponent<VAUAuralizationMode>().AuraStringChanged -= OnListenerAuralizationModeChanged; GetComponent<VAUAuralizationMode>().AuraStringChanged -= OnListenerAuralizationModeChanged;
......
...@@ -116,7 +116,7 @@ public class VAUSoundSource : MonoBehaviour ...@@ -116,7 +116,7 @@ public class VAUSoundSource : MonoBehaviour
GetComponent<VAUAuralizationMode>().AuraStringChanged -= OnSoundSourceAuralizationModeChanged; GetComponent<VAUAuralizationMode>().AuraStringChanged -= OnSoundSourceAuralizationModeChanged;
} }
void OnDestroy() private void OnDestroy()
{ {
_VA = VAUAdapter.VA; _VA = VAUAdapter.VA;
if (_VA.IsConnected()) if (_VA.IsConnected())
......
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