Forum Discussion
maumau.tuna
1 year agoExplorer
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
[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
[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
[7]
Acoustic Geometry in Acoustic Ray Tracing for Unity
[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
[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}
...
12 Replies
Replies have been turned off for this discussion
- maumau.tunaExplorer
Can I get any samples for Unity that use the Acoustic Ray Tracing in Meta XR Audio SDK? There doesn't seem like anything even in the latest SDK version 68, which was released on Aug 21, 2024. I need examples that really work, because my test project doesn't make any sound when I switch to Acoustic Ray Tracing mode.
- fefemateHonored Guest
I have the exact same problem, did you manage to solve it?
- maumau.tunaExplorer
No, I couldn't figure out what was wrong with my application above. However, I could successfully use the Acoustic Ray Tracing with another application.
- fefemateHonored Guest
Hi everyone,
I came across these two threads that describe exactly the same problem I'm currently facing with the Meta XR Acoustic Ray Tracing system:
In short:
I have a properly configured scene with MetaXRAcousticGeometry, MetaXRAcousticMaterial, and a valid MeshCollider.
The geometry is being loaded (confirmed in the console), and the acoustic rays appear to be active.
However, there is either no audible reverb, or the sound becomes extremely quiet when geometry is enabled.
Once I remove the geometry, the audio becomes louder again — but of course, spatial acoustic effects are lost.
I've already verified:
MetaXRAudioSource is enabled with Gain = 1.0 and ReverbSendLevel = 1.0
The mesh is valid (not empty, and vertex count > 0)
Spatialization is enabled, and the listener is positioned correctly
Tried both with and without MetaXRAudioRoom
My question is:
Has anyone in the community — or from Meta — found any working solution or explanation for this behavior in the past year?Any updated guidance, examples, or even diagnostic tips would be greatly appreciated.
Thanks in advance!
- Anonymous
Just FYI I've merged your report into the other ones so we can consolidate all the data into one place! Thanks for letting us know about this.
- fefemateHonored Guest
Can you please give me a project file that works in your environment? Google drive link or something like that? For me the bake all scenes returns with an error:
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index System.Collections.Generic.List1[T].get_Item (System.Int32 index) (at <eff339db7078454ba937ee94b64ae191>:0) MetaXRAcousticSerializationManager.BakeNextRemainingScene (System.Collections.Generic.Stack1[T] remainingSceneGuids, System.Collections.Generic.HashSet1[T] bakedSceneGroups, System.Collections.Generic.HashSet1[T] bakedGeoPaths, System.Collections.Generic.HashSet1[T] bakedMapPaths) (at ./Library/PackageCache/com.meta.xr.sdk.audio@6cf42e620e3e/editor/MetaXRAcousticSerializationManager.cs:75) MetaXRAcousticSerializationManager.BakeAllScenes () (at ./Library/PackageCache/com.meta.xr.sdk.audio@6cf42e620e3e/editor/MetaXRAcousticSerializationManager.cs:65)- maumau.tunaExplorerIt's difficult to give you my project files, because I'm hesitant to show you the entire project and thus have to extract necessary files.According to your stack trace, the following line throws the exception. This seems to indicate that tempSceneLoads is empty for some reason. There is something wroing with the scene list in your project??./Library/PackageCache/com.meta.xr.sdk.audio@6cf42e620e3e/editor/MetaXRAcousticSerializationManager.cs:75BakeAcousticsForScene(tempSceneLoads[0].scene, bakedSceneGroups, bakedGeoPaths, bakedMapPaths,If you cannot figure out the above reason, then try the menu "Bake current scene" after making the fix below.In ./Library/PackageCache/com.meta.xr.sdk.audio@6cf42e620e3e/editor/MetaXRAcousticSerializationManager.csChange this lineOnStart.Invoke();to:if (OnStart != null)OnStart.Invoke();Good luck. I look forward to hearing your success.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device