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

made VAUnity deployable.

From now on audio files have to be stored in the Asset folder and in the VA folder under data/Audiofiles
parent 756170a7
using UnityEngine; using UnityEngine;
using UnityEditor;
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -10,7 +9,7 @@ using VA; ...@@ -10,7 +9,7 @@ using VA;
public class VAUAdapter : MonoBehaviour { public class VAUAdapter : MonoBehaviour {
private static string HostIP = "VRBOX5"; private static string HostIP = "localhost";
public static string GlobalAuralizationMode = "all"; public static string GlobalAuralizationMode = "all";
private static int Port = 12340; private static int Port = 12340;
private static string DefaultHRIRPath = "$(DefaultHRIR)"; private static string DefaultHRIRPath = "$(DefaultHRIR)";
...@@ -75,8 +74,8 @@ public class VAUAdapter : MonoBehaviour { ...@@ -75,8 +74,8 @@ public class VAUAdapter : MonoBehaviour {
_VA = new VANet(); _VA = new VANet();
Init(); Init();
DeactivateUnitySound(); DeactivateUnitySound();
if (! (_VA.AddSearchPath(Application.dataPath + "/.."))) // if (! (_VA.AddSearchPath(Application.dataPath + "/..")))
Debug.Log("[VA] Could not add SearchPath:" + Application.dataPath + "/.."); // Debug.Log("[VA] Could not add SearchPath:" + Application.dataPath + "/..");
} }
void OnEnable() void OnEnable()
......
using UnityEngine; using UnityEngine;
using UnityEditor; using System.IO;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using VA; using VA;
...@@ -54,7 +53,7 @@ public class VAUSoundSource : MonoBehaviour { ...@@ -54,7 +53,7 @@ public class VAUSoundSource : MonoBehaviour {
{ {
if (GetComponent<AudioSource>().clip != null) if (GetComponent<AudioSource>().clip != null)
{ {
SignalSource = _VA.CreateAudiofileSignalSource(AssetDatabase.GetAssetPath(GetComponent<AudioSource>().clip), this.name + "_signal"); SignalSource = _VA.CreateAudiofileSignalSource( "Audiofiles/" + GetComponent<AudioSource>().clip.name + ".wav", this.name + "_signal");
_VA.SetSoundSourceSignalSource(SoundSource, SignalSource); _VA.SetSoundSourceSignalSource(SoundSource, SignalSource);
Debug.Log("[VAU]" + SignalSource + " connected to SoundSource " + SoundSource); Debug.Log("[VAU]" + SignalSource + " connected to SoundSource " + SoundSource);
_VA.SetAudiofileSignalSourcePlaybackAction(SignalSource, "PLAYING"); _VA.SetAudiofileSignalSourcePlaybackAction(SignalSource, "PLAYING");
......
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