Question About Reverb 3D

I’m having trouble getting the Reverb3D feature to work. I’ve followed all the steps in the documentation, and everything seems to be in order. My project structure is also quite simple; I just used a sphere to represent the area. Here is my code:

What version of Unity and the FMOD for Unity plugin are you using? Also, could I get you to copy the entire ReverbSpatialize class as text instead of a screenshot? You can wrap your code in triple backticks (```) to format it properly, i.e.

```
MyCodeHere();
```

becomes:

MyCodeHere();

Unity :2022.3.9f1
Fmod:2.02.09

using System;
using System.Collections;
using System.Collections.Generic;
using FMOD;
using FMODUnity;
using UnityEngine;
using Debug = UnityEngine.Debug;

public class ReverbSpatialize : MonoBehaviour
{
    public GameObject listener;
    public GameObject player;
    REVERB_PROPERTIES reverbProperties = PRESET.GENERIC();
    private VECTOR reverbPosition;
    private Reverb3D reverb;
    public float minidistance = 10.0f;
    public float maxdistance = 15.0f;
    
    void OnEnable()
    {
        RuntimeManager.CoreSystem.createReverb3D(out reverb);
        reverb.setProperties(ref reverbProperties);
        reverbPosition = RuntimeUtils.ToFMODVector(transform.position);
        reverb.set3DAttributes(ref reverbPosition, minidistance, maxdistance);
        reverb.setActive(active: true);
    }

    private void OnDisable()
    {
        reverb.release();
    }

    void Update()
    {
        var listenerPosition = RuntimeUtils.ToFMODVector(listener.transform.position);
        var listenerForward = RuntimeUtils.ToFMODVector(listener.transform.forward);
        var listenerUp = RuntimeUtils.ToFMODVector(listener.transform.up);
        var listenerVelocity = RuntimeUtils.ToFMODVector(player.GetComponent<Rigidbody>().velocity);
        RuntimeManager.CoreSystem.set3DListenerAttributes(0,ref listenerVelocity, ref listenerPosition, ref listenerForward, ref listenerUp);
        Debug.Log($"listener position: {listener.transform.position}" + "\n" + $"listener forward: {listener.transform.forward}" + "\n" + $"listener up: {listener.transform.up}"
                  + "\n" + $"listener velocity: {player.GetComponent<Rigidbody>().velocity}" + "\n" + $"reverb position: {transform.position}" + "\n" + $"minidistance: {minidistance}"
                  + "\n" + $"maxdistance: {maxdistance}" + 
                  "\n" + $"reverb properties: {reverbProperties}");
    }
}

Actually,this is my entire class. i just create a sphere with a studio event emitter,and put the script on it.
However, i just wonder if we assume that reverb 3D can’t work well on my project, is there any ways to create reverb with spatial information.
We now working on a game using fmod,but we need to custom a feature like wwise portal ,so we need to spatialize the reverb,thanks for your reply

anyone can help me T_T

The code appears to be missing a call to Studio::EventInstance::setReverbLevel, which by default is set to 0. Try setting it to a different value with the index that matches your Reverb3D, and see whether it works as expected. You will need to grab the StudioEventEmitter::EventInstance to do so.

As for spatializing a reverb signal, the main way I would recommend doing it would be to use a reverb send that has a muted output, but has a transceiver in the signal chain set to the “transmit” mode. Then, you can create an event with a corresponding transceiver in “receive” mode, and a spatializer on the output.

In-game, you can place the receiving event in a specific space - the wet reverb signal will be transmitted to this event, and then spatialized based on its position. You can go further, for example, by automating reverb volume and/or filtering based on the distance between the player and the receiving event.

Depending on the detail level of audio propagation that you require, you may also find it practical to make use of third party plugins like Resonance Audio or Steam Audio, which can model propagation more accurately than FMOD’s stock SFX reverb effect.

oh god, you guys are really helpful and nice,thanks four your advice.Once i have done this spatial audio plan, i wiil share it on the forum. :smiling_face_with_three_hearts:

1 Like

Another question plz,if i muted the reverb,there is no signal to receive event

this is original event send to “room1reverb” reverb bus.

the picture of reverb bus

here is my receive event

please somebody help me :sob:

please help me,our company will buy license if we develop this feature :sob:

My apologies - muting is applied at the bus’ fader, so you’ll want to do one of the following to ensure the signal flows to the transceiver but is still inaudible:

  • Place the reverb and transceiver before the fader on your reverb bus, and continue to use the bus’ mute toggle
  • Keep the reverb and transceiver in the place they currently are, place a gain effect after them, and then “mute” using the gain effect instead by setting it to -∞ dB

love from china

1 Like