Technical Details
Last updated
Last updated
The provided by Unity is a 4-pole filter (24dB/Oct) with a Resonance Q value. At first glance, it seems pretty standard, but it actually comes with some issues. Firstly, the Resonance Q can only be set to a minimum value of 1, meaning you can't fully eliminate the resonance effect.
The image above shows two High Pass Filter with different Q values settings. You can clearly see that when the Q is set to 1, there's a noticeable gain increase, whereas with a Q of 0.71, the response remains flat (the "flat" value may vary depending on the filter design).
This leads to another problem: clipping. Let's say we set a Highpass filter's frequency to 20Hz to mimic bypassing (since most audio doesn't have frequencies under 20Hz). Due to the inability to eliminate resonance, if the audio contains many lower frequencies, the resonance might cause clipping. This was a real issue encountered during the development of BroAudio's demo scene.
This short period typically falls around 30 milliseconds or less. Usually, the same sound is played within such a short time unintentionally, for example:
Playing every frame (through Update(), FixedUpdate(), OnCollisionXXX, OnTriggerXXX …etc) note: 30fps ≈ 33ms per frame, 60fps ≈ 16ms per frame.
For simplicity and stability reasons, Bro opts for the —a 2-pole filter (12dB/Oct) without Resonance. Combining two filters still gives us a 4-pole filter, while also providing the flexibility to choose between the two filter types.
If the same sound is played repeatedly in a very short period. It may cause a quality loss or unexpected behavior due to the nature of .
Using , where the animations use to play sounds. During the transition between two animations, both Animation Events may trigger in a very short period. For instance, during the transition between walking and running animations, both of their AnimationEvent will be triggered in the same single footstep, resulting the sound being played within a short period.
To address this, Bro Audio has implemented a preventive mechanism. If the same is played again within this short period, it will be canceled.
In the settings, you’ll find a field called ‘Time To Prevent Comb Filtering.’ This value represents the shortest interval between two identical sounds. By default, it’s set to 0.04 seconds (40ms). Feel free to adjust this value according to your specific needs or disable the feature by setting it to 0.