Acoustic Ray Tracing for Unity does not make any sound
I should have done everything I should do, but my test project does not make any sound with Acoustic Ray Tracing of Meta XR Audio SDK. What are the likely solutions? The project makes sounds normally when I disable Acoustic Ray Tracing. My environment - Windows 11 - Unity 2022.3.36f1 - Visual Studio 2022 - My Unity project is a simple non-XR 3D maze What I did: (1) Installed Meta XR Audio SDK Plugin for Unity tarball into my Unity project, following "Method 2: Download via the Meta Quest Developer Center" in [1]. (2) Set up my Unity project to enable Meta XR Audio SDK, following "Unity Project Setup" in [1]. The project settings is [2]. (3) The sounds are imported into Unity by forcing them to mono [3]. (4) Enable spatialization on my AudioSource components as per "Implementation" in [4]. The resulting setting is [5]. Attached the script MetaXRAudioSource.cs to the Audio Source’s GameObject. The optional MetaXRAudioSourceExperimentalFeatures.cs is not attached. (5) Attached the sample SpatializerMixer, which is included in Meta XR Audio SDK, to the output of AudioSource components, following "Setup the Audio Mixer" in [6]. The resulting setting is [5]. (6) Added Acoustic Geometry as per [7]. Specifically, attached an MetaXRAcousticGeometry component to the parent GameObject that have various geometries like walls, floor, and ceiling as its children. "Include Child Meshes" is enabled. The resulting setting is [8]. Then baked the acoustic geometry. The baked data is generated in the file StreamingAssets/Acoustics/<scene name>/<parent GameObject name>.xrageo. (7) Added a new GameObject and attached the MetaXRAcousticMap component to it, as per [9]. The resulting setting is [10]. Then baked the acoustic map. The Unity Editor's Inspector shows the acoustic map as READY. The baked data is generated in the file StreamingAssets/Acoustics/<scene name>.xramap. (8) Played the scene in the Unity Editor, but I can hear no sound from spatialized audio. On the other hand, non-spatialized audio make sounds. However, the Unity console shows that the acoustic geometry and map are loaded successfully as follows: Found data in default location: StreamingAssets/Acoustics/Level 1.xramap ... Applying Acoustic Propagation Settings: [acoustic model = Automatic], [diffraction = True], ... Setting spatial voice limit: 64 ... Loading Geometry Maze1 from StreamingAssets C:/Unity/projects/amaze3d/Assets/StreamingAssets/Acoustics\Level 1\Maze1.xrageo ... No Meta XR Audio Room found, setting default room ... Fallback handler could not load library C:/Program Files/Unity/Hub/Editor/2022.3.36f1/Editor/Data/MonoBleedingEdge/lib/MetaXRAudioWwise ... Fallback handler could not load library C:/Program Files/Unity/Hub/Editor/2022.3.36f1/Editor/Data/MonoBleedingEdge/lib/libMetaXRAudioFMOD Meta XR Audio Native Interface initialized with Unity plugin ... Geometry Maze1, read time = 0.02320397 ... Sucessfully loaded Geometry Maze1, load time = 0.06603026 ... Simplified mesh with 3563 vertices ... References [1] Meta XR Audio SDK Plugin for Unity - Requirements and Setup https://developer.oculus.com/documentation/unity/meta-xr-audio-sdk-unity-req-setup/ [2] ProjectSettings/AudioManager.asset ... m_Volume: 1 Rolloff Scale: 1 Doppler Factor: 1 Default Speaker Mode: 2 m_SampleRate: 0 m_DSPBufferSize: 256 m_VirtualVoiceCount: 512 m_RealVoiceCount: 32 m_EnableOutputSuspension: 1 m_SpatializerPlugin: Meta XR Audio m_AmbisonicDecoderPlugin: Meta XR Audio m_DisableAudio: 0 m_VirtualizeEffects: 1 m_RequestedDSPBufferSize: 256 [3] <sound file name>.mp3.meta ... forceToMono: 1 ... ambisonic: 0 3D: 1 ... [4] Apply Spatialization in Unity https://developer.oculus.com/documentation/unity/meta-xr-audio-sdk-unity-spatialize/ [5] FPSController.prefab ... --- !u!82 &8200000 AudioSource: ... m_Enabled: 1 serializedVersion: 4 m_PlayOnAwake: 1 m_Volume: 1 m_Pitch: 1 Loop: 0 Mute: 0 Spatialize: 1 SpatializePostEffects: 0 Priority: 128 DopplerLevel: 0 MinDistance: 1 MaxDistance: 100 Pan2D: 0 rolloffMode: 2 BypassEffects: 0 BypassListenerEffects: 0 BypassReverbZones: 0 ... --- !u!114 &8500000 MonoBehaviour: ... m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: a07f270ac36c49789466c75ceb88424c, type: 3} ... enableSpatialization: 1 gainBoostDb: 10 enableAcoustics: 1 reverbSendDb: 0 [6] Apply Room Acoustics in Unity https://developer.oculus.com/documentation/unity/meta-xr-audio-sdk-unity-room-acoustics/ [7] Acoustic Geometry in Acoustic Ray Tracing for Unity https://developer.oculus.com/documentation/unity/meta-xr-acoustic-ray-tracing-unity-geometry/ [8] Level1.unity ... --- !u!114 &2007814857 MonoBehaviour: ... m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 46bc5ac24d7ec0348bb607bf4ed1f00d, type: 3} ... IncludeChildMeshes: 1 relativeFilePath: StreamingAssets/Acoustics/Level 1/Maze1.xrageo [9] Acoustic Maps in Acoustic Ray Tracing for Unity https://developer.oculus.com/documentation/unity/meta-xr-acoustic-ray-tracing-unity-map/ [10] Level1.unity ... --- !u!1 &2008814857 GameObject: m_ObjectHideFlags: 0 ... m_Component: - component: {fileID: 2008814859} - component: {fileID: 2008814858} m_Layer: 0 m_Name: Test Acoustic Map m_TagString: Untagged ... m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &2008814859 Transform: m_ObjectHideFlags: 0 ... m_GameObject: {fileID: 2008814857} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &2008814858 MonoBehaviour: m_ObjectHideFlags: 0 ... m_GameObject: {fileID: 2008814857} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: a96b764f28a53ab488bd80d19c0c167a, type: 3} ...1.9KViews0likes12CommentsHow to learn MetaXR Spatial Anchors for Unity
Hello! I cannot seem to follow the documentation for MetaXR Spatial Anchors - they implemented 'Building Blocks' and I cannot find any documentation for it, I am working on a simple singleplayer local spatial anchor setup and I simply cannot make any headway. How do I learn to use this feature? Its so important for Mixed Reality 😞 Also - if you happen to know the most stable version of Unity and MetaXR (or if you use other XR integrations) that offer DepthAPI Dynamic Occlusion/Room meshes/Floor pathing for NPC's, otherwise I've been struggling on Unity 2022.3.24f1 with MetaXR v63812Views0likes0CommentsProblems with Spatial Anchors
Hello, I've been having some issues for quite a while with spatial anchors. I tried to dabble with them some months ago with little success and now I'm trying again. I've had very inconsistent result with the samples where sometimes they work and other times I can't even place the anchor. In my code all I want to do for now is call this function to place the anchor: public void PlaceLeftAnchor(Vector3 position, Quaternion rotation) { SpatialAnchor anchor = Instantiate(m_AnchorPrefab.GetComponent<SpatialAnchor>(), position, rotation); anchor.SaveAnchorLocally(); } and here is the SpatialAnchor code based on the oculus samples: using System.Collections; using UnityEngine; [RequireComponent(typeof(OVRSpatialAnchor))] public class SpatialAnchor : MonoBehaviour { [SerializeField] private OVRSpatialAnchor m_SpatialAnchor = null; public string Uuid { get => m_Uuid; } private string m_Uuid = ""; private IEnumerator Start() { while (m_SpatialAnchor && !m_SpatialAnchor.Created) { yield return null; } Debug.LogError($"Achor created. Enabled?: {m_SpatialAnchor.enabled}"); } public void SaveAnchorLocally() { Logger.Instance.LogError($"Saving anchor start. Status of anchor component: {m_SpatialAnchor == null} / {m_SpatialAnchor.enabled}"); m_SpatialAnchor.Save((anchor, success) => { // --> Never reaches this part <-- }); Logger.Instance.LogError($"End of Save Anchor"); } } I don't manage to receive a callback within the m_SpatialAnchor.Save function and that seems to be the case due to the spatial anchor self-destructing itself. I get this error: As a side note, I noticed that the anchors weren't working in the samples, until I added this line (<uses-permission android:name="com.oculus.permission.USE_ANCHOR_API" />) to the manifest. Now I was able to place and save the samples, but that wasn't enough to fix my own implementation. Perhaps I am missing more permissions? If would greatly appreciate anyone who could provide insights or their own working example of a spatial anchor implementation.2.2KViews0likes1Comment