Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Audio Why High Pass Filter can't have 0 hz cutoff or be disabled entirely?

Discussion in 'Audio & Video' started by hermitcat64, Sep 7, 2020.

  1. hermitcat64

    hermitcat64

    Joined:
    Apr 18, 2020
    Posts:
    16
    Unity's mixer has a big "B" button that effectively disables an effect but for some reason there is no API for it to write scripts. Snapshots are no help at all. Also it can't have cutoff hz lower than 10.
    What's interesting is that I also noticed that it's the same story in FMOD.
    Is there any technical reason for such limitation?
     
  2. janm_unity3d

    janm_unity3d

    Unity Technologies

    Joined:
    Jun 12, 2012
    Posts:
    36
    Hi, the mute/solo/bypass buttons are UI only features. There is a way though to achieve what you want by enabling wet mixing on the effects you want to dynamically enable/disable. This also allows gradually fading the effects in and out. All you need to do is right-click on the effect in the mixer channel strip, select the "Allow Wet Mixing" option and then you can already set the default mix level by dragging horizontally on the effect. It is also possible to select it in the effect drop-down in the inspector for the channel strip. You can then expose the parameter by right-clicking on the "Wet" label in that effect in the inspector. Note that there is a bug currently that causes that slider to not appear right after you toggled the "Allow Wet Mixing" option, so you need to deselect and select the channel strip again before the "Wet" slider becomes visible. You can then expose that parameter such that it becomes controllable via scripts. Also note that the parameter is in dB ranging from -80 to 0 where -80 is the threshold at which the effect is fully deactivated, so if it's an expensive effect in terms of CPU it makes sense to set it to that exact value or lower to turn it off. Check out this video to see how to use the exposed parameter API: