BroAudio
Quick StartScripting APIAsset Store
  • Overview
    • Introduction
    • Getting Started
    • Compatibility
  • Core Features
    • Library Manager
      • Create The Library
      • Design The Sound
        • 🔊Volume
        • 🎚️Fading
        • 🔁Looping
        • 🎲Randomization
        • 💪Velocity
        • 🎛️Spatial & Mix
    • Audio Player
      • Music Player
      • Dominator Player
    • Playback Group
    • Audio Effect
    • No-Code Components
      • Sound Source
      • Sound Volume
      • Spectrum Analyzer
    • Addressables
    • Customization
  • Designs
    • Audio Mixer
  • Tools
    • Audio Clip Editor
    • Audio Effect Editor
    • Useful Attrubutes
  • Reference
    • Scripting API
      • Class
        • BroAudio
        • SoundSource
        • BroAdvice
      • Interface
        • IAudioPlayer
        • IMusicPlayer
        • IPlayerEffect
        • IAutoResetWaitable
        • IAudioSourceProxy
      • Struct
        • SoundID
        • Effect
        • Fading
      • Enums
        • BroAudioType
        • EffectType
        • StopMode
        • Transition
        • Ease
    • Unity API Integration
    • Audio Terminology
    • Technical Details
  • Others
    • Release Notes
    • Known Issues
      • Duplicate SoundID Issue
    • Roadmap
    • Support & Contact
Powered by GitBook
On this page
  • Introduction
  • How To Use
  • Create an 'Effect' data struct
  • BroAudio.SetEffect(Effect, BroAudioType)
  • Add more effect
  • Limitation
  1. Core Features

Audio Effect

Last updated 1 year ago

Introduction

Audio effects can enhance the immersion and fun of your game. BroAudio supports all the built-in effects of the Unity and allows dynamic adjustment of all parameters during gameplay.

How To Use

Create an '' data struct

To trigger an audio effect at runtime, you need to create an 'Effect' struct with the parameter values via the static factory methods. This data will be passed as a parameter to the SetEffect APIs.

// Create high pass filter and low pass filter effect
Effect highPassFilter = Effect.HighPass(highPassFrequency, fadeTime);
Effect lowPassFilter = Effect.LowPass(lowPassFrequency, fadeTime);

//Create a custom effect
Effect reverbEffect = Effect.Custom("exposedParameter", value, fadeTime);
//The custom effect and "exposedParameter" must be created and available in BroAudioMixer.

BroAudio.SetEffect(Effect, BroAudioType)

Common use cases and API examples:

When the player is underwater

Effect lowPassFilter = Effect.LowPass(freq, fadeTime);
BroAudio.SetEffect(lowPassFilter, BroAudioType.SFX | BroAudioType.Ambience); 

// Or write it in one line!
BroAudio.SetEffect(Effect.LowPass(freq, fadeTime)); 

// If the BroAudioType is not specified, it will apply to all.

Add more effect

Bro Audio only offers two initial effects, but you can add more! However, since BroAudio has already set up a comprehensive audio mixer with numerous Exposed Parameters, editing it directly through Unity's Audio Mixer Window can be challenging.

Limitation

Currently, BroAudio only provides one Effect track, so it's not possible to add different Effects to various sounds individually. More versatile and powerful Audio Effect features are still in development. Please be patient, and feel free to provide feedback, suggestions, or support to BroAudio, helping expedite the release of this feature.

Therefore, it's highly recommended to use the '' to add more effect. It lets you focus on the 'Effect' track and only displays the Exposed Parameters of the Audio Effects.

Audio Mixer
Effect
Audio Effect Editor
Page cover image