cancel
Showing results for 
Search instead for 
Did you mean: 

Basic reverb in Oculus Spatializer Unity

ShawnFeatherly
Explorer
Hello, I'm trying to set up the most basic and obvious room acoustics scene I can using the Oculus Spatializer Unity package. I'm having difficulty with the example provided.

I've reviewed the documentation on http://developer.oculus.com/documentation/audiosdk/latest/concepts/ospnative-unity-scene/ . Yet it did not have enough detail for me to actually tell that the RedBallGreenBall had a reverb being applied. When one of the audio clips was played by it self it sounded like it had the same reverb as when it was being played in the scene through the mixer.

I admit I don't have an ear for reverb. So I tried to make the RedBallGreenBall scene more basic and get more of an echo out of it than reverb. Using the hammer audioclip provided as it seemed like it'd produce a more obvious echo. Then a "stiletto walk" sound clip I found. I tried setting all of the OculusSpatializerReflection's Wall Reflection Coefficients to their maximum then their minimum values for both init and interior snapshots. No luck with anything.

How do I setup the most basic room acoustics scene so that I can blatantly tell that a reverb (or, even better, an echo) is being applied. Being able to set something up like stiletto heels echoing inside of a cave would be great for my untrained ears to figure out what the settings do.

Unity2018.2.0f1
ovr_audio_spatializer_unity_1.27.0.zip

7 REPLIES 7

ShawnFeatherly
Explorer
I had some un-reproducible luck. After applying some somewhat unrelated steps from https://forums.oculusvr.com/developer/discussion/68246/oculus-native-spatializer-for-unity-vs-first-... I heard some distinct and blatant reverb in RedBallGreenBall :-). Yay!

Yet, when I created a brand new Unity project to see if I could see what step made it actually work, I was unable to get it to work again after re-applying all the steps. So my issue now is that the OculusSpatializer package inconsistently works. I have been unable to tell what got it to work. Maybe the setup instructions on https://developer.oculus.com/documentation/audiosdk/latest/concepts/ospnative-unity-req-setup/ need another step or two?

Petroza
Heroic Explorer
All you should need to do is turn on reflections for each sound, and then turn on the reflections and reverb on the OculusSpatializerReflection (where you set the room dimensions).

If you're not hearing anything in your project perhaps you missed one of the steps like setting it to the Oculus spatializer in the project settings?

The reflections can be subtle when the room is small and/or the listener is close to the sound. The should be more obvious when the sound is further from the listener and the room is large. The reverb should be pretty obvious with short sounds like the hammer or footsteps.

ShawnFeatherly
Explorer
Thanks @Petroza. It's helpful to know what positions will cause the most noticeable reverb. I also appreciate the help checking "Project Settings -> Audio".

Though I'm still not able to get it consistently working. Most of the steps below are already setup in RedBallGreenBall. Yet I only get RedBallGreenBall to process reverb some of the time. So I'm trying to understand all the steps.
1. Edit -> Project Settings -> Audio -> spatializer Plugin should be set to OculusSpatializer
2. You need to add a ONSPReflectionZone to a gameobject (maybe 2 is required?). Each gameobject should also have a box collider and be at a scale of at least 50, 50, 50. If it's less than 30,30,30 or more than ... 500,500,500 you're unlikely to hear reverb.
3. An audio Mixer should be created that has a seperate snapshot for each ONSPReflectionZone
4. The Master channel of the mixer should include an OculusSpatizerReflection effect
5. The audio source component should have a ONSPAudioSource component with the first 3 checkboxes checked; Spatialization, Reflections, and Attenuation
6. The audio source component should have output set to the mixer referenced by the ONSPRelfectionZones in step #3
7. The audio source component should have spatialize checked
8. Both the AudioListener and the AudioSource should be inside of the Box Collider of the ONSPReflectionZone. Put the AudioListener and the AudioSource at opposite corners of the ONSPReflectionZone's BoxCollider to hear the most noticable effect

If you see a white box collider around the audio-listener change to a light blue, tall and thin box it doesn't seem to be related to reflections being processed, it just seems to mean that the listener is inside of the ONSPReflectionZone.

Again, the steps above don't actually seem to work all the time. I'm hoping they're close to the steps that should be taken to create a basic reverb scene using the Oculus Spatializer in Unity.

petergiokaris
Protege
Hi Shawn,

Sorry to hear that you are having some issues with hearing reverberation. The current setup has it that you must enable Reflection Engine in the mixer plug-in before you can enable the Reverberation. Because of this, the reverb may get lost underneath the early reflection portion of the sound. 

There may be a logic issue involved here that is further causing the reverberation to not be heard. This may actually lie within the reflection engine itself or the ONSPReflectionZone script. I would recommend NOT using the ONSPReflectionZone scripts to test for reverb until it can be sorted out that you can actually hear the reverberation part of the reflection engine.

We are adding a new feature into the next release of the Unity native spatializer which decouples the early reflections from the reverb. This way you can choose between either early reflections, reverb, or both. It is quite obvious to hear reverb with reflections off. Because reflections DSP cycles increase with more voices that have early reflections turned on, and because the reverb is a (relatively) fixed cost to the DSP, disabling all early reflections will create a significant reduction to the DSP load.

We should be releasing the next audio SDK within the next few weeks, so please keep a lookout for it.
Peter Giokaris Senior Software Engineer

ShawnFeatherly
Explorer
Thanks @petergiokaris. I look forward to the next release. Until then I found out about the OculusSpatializerReflection that comes with Unity.

The OculusSpatializerReflection that Unity comes with is a primitive version of the OculusSpatializerReflection effect. It doesn't have as many features as the Oculus Spatializer *.unitypackage. The major feature missing is the downloadable *.unitypackage allows you to define the location of the shoebox creating the reverb. The primitive version built into Unity does not, instead it always has the AudioListener at the center of the shoebox creating the reverb. However the primitive version is quite a bit easier to setup and seems more consistent.

To set it up from a completely empty Unity project:

1. Edit -> Project Settings -> Audio -> spatializer Plugin should be set to OculusSpatializer
2. In the project panel, Right click -> Create -> Audio Mixer
3. Add an OculusSpatializerReflection effect to the Master channel of the AudioMixer that you just created. Then setup that effect to be a very reflective hallway using the following properties:
   GScale: 1
   E.Rflt On: 1
   E.Rflt Rev On: 0
   Room X: 1
   Room Y: 1
   Room Z: 200
   Left:  0.97
   Right: 0.97
   Up:    0.97
   Down:  0.97
   Behind:0.97
   Front: 0.97
   Shared Rev Min: 1
   Shared Rev Max: 250
4. Create a new scene, the camera should be left at it's default position of 0, 1, -10
5. Add an empty game object at 0,0,0 that has an AudioSource component with:
   AudioClip: set to any audioclip you want to test with, vocal1.ogg from the UnitySpatializer.unitypackage worked well for this
   Output: Master (This is the channel of the audio mixer you created in step #2)
   Spatial Blend: 1
   Spatialize: checked

This method consistently applies a spatially based reverb. I tried to make it the most apparent blatant echo I could. A shoebox room used for reverb being a long hallway seemed to produce the most echo. If you have any ideas to make the echo stronger please do comment.

ShawnFeatherly
Explorer
To save anyone else grief the inbuilt OculusSpatializerReflection does not have any effect in Unity 5.6.3f1. I tried it in an older project. It does work in 2017.3.1f1 & 2018.2.0f2

ShawnFeatherly
Explorer
I've been running into other instability issues with the inbuilt OculusSpatializerReflection and have found some work arounds. I've also been modifying the OculusSpatializerReflection values from my post above by editing a blog post: http://feddas.blogspot.com/2018/08/unity3d-spatially-based-reverb.html