Commit f8680e81 authored by Maurice Tayeb Andreas's avatar Maurice Tayeb Andreas

Added Tooltips and a pause/stop option on disable of a SoundSource

parent 3a10664d
...@@ -4,10 +4,13 @@ using UnityEngine; ...@@ -4,10 +4,13 @@ using UnityEngine;
public class VAUAudiofileSignalSource : VAUSignalSource public class VAUAudiofileSignalSource : VAUSignalSource
{ {
public string FilePath; // Absolute or relative path to audio file (relative to Assets folder or any folder added to search path using AddSearchPath) [Tooltip("Absolute or relative file path (relative to Assets folder or any folder added to search path using AddSearchPath)")]
public string FilePath;
public string Name; // Versatile name public string Name; // Versatile name
public bool IsLooping = true; // Will loop the audio signal source [Tooltip("Will loop the audio signal source.")]
public bool PlayOnStart = true; // Will immediately start the signal source payback public bool IsLooping = true;
[Tooltip("Will immediately start the signal source payback.")]
public bool PlayOnStart = true;
void Awake() void Awake()
{ {
......
...@@ -5,7 +5,8 @@ using UnityEngine; ...@@ -5,7 +5,8 @@ using UnityEngine;
public class VAUDirectivity : MonoBehaviour { public class VAUDirectivity : MonoBehaviour {
protected int _ID = -1; // Stores the internal id that is assigned by VA protected int _ID = -1; // Stores the internal id that is assigned by VA
public string FilePath = ""; // Absolute or relative path (relative to Assets folder), also use AddSearchPath for special folders. [Tooltip("Absolute or relative path (relative to Assets folder), also use AddSearchPath for special folders.")]
public string FilePath = "";
public string Name = ""; // Versatile name for this directivity public string Name = ""; // Versatile name for this directivity
public int ID public int ID
......
...@@ -5,7 +5,8 @@ using UnityEngine; ...@@ -5,7 +5,8 @@ using UnityEngine;
public class VAUHRIRDataset : MonoBehaviour { public class VAUHRIRDataset : MonoBehaviour {
protected int _ID = -1; // ID assigned by VA protected int _ID = -1; // ID assigned by VA
public string FilePath = ""; // Absolute or relative file path (relative to Assets folder or any folder added to search path using AddSearchPath) [Tooltip("Absolute or relative file path (relative to Assets folder or any folder added to search path using AddSearchPath)")]
public string FilePath = "";
public string Name = ""; // Versatile name public string Name = ""; // Versatile name
public int ID public int ID
......
...@@ -8,13 +8,18 @@ public class VAUListener : MonoBehaviour { ...@@ -8,13 +8,18 @@ public class VAUListener : MonoBehaviour {
public string Name = "Listener"; public string Name = "Listener";
[Tooltip("Number of reverbzones used for determining the current reverb.")]
public int NumMaxReverbZones = 2; public int NumMaxReverbZones = 2;
public string VAAudioRenderer = "MyBinauralArtificialReverb"; public string VAAudioRenderer = "MyBinauralArtificialReverb";
[Tooltip("Add custom VAUHRIR dataset.")]
public VAUHRIRDataset HRIR = null; public VAUHRIRDataset HRIR = null;
public double HeadWidth = 0.12; // Anthropometric data, for HRIR individualization or generic binaural cues [Tooltip("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 HeadWidth = 0.12;
public double HeadDepth = 0.15; // Anthropometric data, for HRIR individualization or generic binaural cues [Tooltip("Anthropometric data, for HRIR individualization or generic binaural cues")]
public double HeadHeight = 0.10;
[Tooltip("Anthropometric data, for HRIR individualization or generic binaural cues")]
public double HeadDepth = 0.15;
private double ShadowHeadWidth; private double ShadowHeadWidth;
private double ShadowHeadHeight; private double ShadowHeadHeight;
......
...@@ -5,16 +5,25 @@ using VA; ...@@ -5,16 +5,25 @@ using VA;
public class VAUSoundSource : MonoBehaviour public class VAUSoundSource : MonoBehaviour
{ {
[Tooltip("Activate this if you want to validate & change volume and mute/unmute state on every update loop.")]
public bool ContinuousGainObserver = false;
public bool ContinuousGainObserver = false; // Activate this if you want to validate & change volume and mute/unmute state on every update loop [Tooltip("Activate this if you dont want to pause the playback while the SoundSource is disabled but rather stop it.")]
public bool stopOnDisable = false;
[Tooltip("Insert a custom VAUDirectivity-Script.")]
public VAUDirectivity Directivity; public VAUDirectivity Directivity;
[Tooltip("Insert a custom VAUSignalSource-Script.")]
public VAUSignalSource SignalSource; public VAUSignalSource SignalSource;
private VANet _VA = null; private VANet _VA = null;
private int _ID; private int _ID;
private Quaternion q; private Quaternion q;
private Transform t; private Transform t;
private string _AudiofileSignalSource = null; private string _AudiofileSignalSource = null;
private bool enable = false;
public int ID public int ID
{ {
...@@ -66,6 +75,7 @@ public class VAUSoundSource : MonoBehaviour ...@@ -66,6 +75,7 @@ public class VAUSoundSource : MonoBehaviour
_VA.SetSoundSourceSignalSource(_ID, _AudiofileSignalSource); _VA.SetSoundSourceSignalSource(_ID, _AudiofileSignalSource);
} }
enable = true;
} }
// Activate auralization mode, if available // Activate auralization mode, if available
...@@ -106,14 +116,20 @@ public class VAUSoundSource : MonoBehaviour ...@@ -106,14 +116,20 @@ public class VAUSoundSource : MonoBehaviour
_VA.SetSoundSourceAuralizationMode(_ID, AuraMode); _VA.SetSoundSourceAuralizationMode(_ID, AuraMode);
} }
public void OnActivation() public void OnEnable()
{ {
if (enable)
_VA.SetAudiofileSignalSourcePlaybackAction(_AudiofileSignalSource, "play");
} }
public void OnDisable() public void OnDisable()
{ {
if (GetComponent<VAUAuralizationMode>()) if (GetComponent<VAUAuralizationMode>())
GetComponent<VAUAuralizationMode>().AuraStringChanged -= OnSoundSourceAuralizationModeChanged; GetComponent<VAUAuralizationMode>().AuraStringChanged -= OnSoundSourceAuralizationModeChanged;
if (stopOnDisable)
_VA.SetAudiofileSignalSourcePlaybackAction(_AudiofileSignalSource, "stop");
else
_VA.SetAudiofileSignalSourcePlaybackAction(_AudiofileSignalSource, "pause");
} }
private void OnDestroy() private void OnDestroy()
......
...@@ -5,6 +5,8 @@ using UnityEngine; ...@@ -5,6 +5,8 @@ using UnityEngine;
public class VAUTextToSpeechSignalSource : VAUSignalSource public class VAUTextToSpeechSignalSource : VAUSignalSource
{ {
public string Name; // Versatile name public string Name; // Versatile name
[Tooltip("Text which should be read out.")]
public string Text = "hi there, my name is rachel. virtual acoustics is a real-time auralization framework for scientific research in Virtual Reality created by the institute of technical acoustics, RWTH aachen university. thank you for testing the VA unity C sharp scripts for controlling a VA server."; public string Text = "hi there, my name is rachel. virtual acoustics is a real-time auralization framework for scientific research in Virtual Reality created by the institute of technical acoustics, RWTH aachen university. thank you for testing the VA unity C sharp scripts for controlling a VA server.";
public bool DirectPlayback = false; public bool DirectPlayback = false;
......
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