# Table of Contents - [Introduction | BroAudio](#introduction-broaudio) - [Getting Started | BroAudio](#getting-started-broaudio) - [Sound Volume | BroAudio](#sound-volume-broaudio) - [Editor Audio Preview | BroAudio](#editor-audio-preview-broaudio) - [Library Manager | BroAudio](#library-manager-broaudio) - [Compatibility | BroAudio](#compatibility-broaudio) - [Scripting API | BroAudio](#scripting-api-broaudio) - [Spectrum Analyzer | BroAudio](#spectrum-analyzer-broaudio) - [Create The Library | BroAudio](#create-the-library-broaudio) - [Volume | BroAudio](#volume-broaudio) - [Fading | BroAudio](#fading-broaudio) - [Randomization | BroAudio](#randomization-broaudio) - [Looping | BroAudio](#looping-broaudio) - [Velocity | BroAudio](#velocity-broaudio) - [Design The Sound | BroAudio](#design-the-sound-broaudio) - [No-Code Components | BroAudio](#no-code-components-broaudio) - [Audio Player | BroAudio](#audio-player-broaudio) - [Sound Source | BroAudio](#sound-source-broaudio) - [Dominator Player | BroAudio](#dominator-player-broaudio) - [Spatial & Mix | BroAudio](#spatial-mix-broaudio) - [Chained Playback | BroAudio](#chained-playback-broaudio) - [Music Player | BroAudio](#music-player-broaudio) - [Playback Group | BroAudio](#playback-group-broaudio) - [Useful Attrubutes | BroAudio](#useful-attrubutes-broaudio) - [Addressables | BroAudio](#addressables-broaudio) - [Audio Effect | BroAudio](#audio-effect-broaudio) - [Audio Effect Editor | BroAudio](#audio-effect-editor-broaudio) - [Audio Clip Editor | BroAudio](#audio-clip-editor-broaudio) - [Customization | BroAudio](#customization-broaudio) - [Class | BroAudio](#class-broaudio) - [Audio Mixer | BroAudio](#audio-mixer-broaudio) - [Technical Details | BroAudio](#technical-details-broaudio) - [Audio Terminology | BroAudio](#audio-terminology-broaudio) - [BroAdvice | BroAudio](#broadvice-broaudio) - [Interface | BroAudio](#interface-broaudio) - [Struct | BroAudio](#struct-broaudio) - [Duplicate SoundID Issue | BroAudio](#duplicate-soundid-issue-broaudio) - [Support & Contact | BroAudio](#support-contact-broaudio) - [IAudioSourceProxy | BroAudio](#iaudiosourceproxy-broaudio) - [Unity API Integration | BroAudio](#unity-api-integration-broaudio) - [EffectType | BroAudio](#effecttype-broaudio) - [StopMode | BroAudio](#stopmode-broaudio) - [Fading | BroAudio](#fading-broaudio) - [Known Issues | BroAudio](#known-issues-broaudio) - [Enums | BroAudio](#enums-broaudio) - [SoundSource | BroAudio](#soundsource-broaudio) - [IMusicPlayer | BroAudio](#imusicplayer-broaudio) - [IAutoResetWaitable | BroAudio](#iautoresetwaitable-broaudio) - [Effect | BroAudio](#effect-broaudio) - [Roadmap | BroAudio](#roadmap-broaudio) - [BroAudioType | BroAudio](#broaudiotype-broaudio) - [IPlayerEffect | BroAudio](#iplayereffect-broaudio) - [Transition | BroAudio](#transition-broaudio) - [Ease | BroAudio](#ease-broaudio) - [SoundID | BroAudio](#soundid-broaudio) - [BroAudio](#broaudio) - [IAudioPlayer | BroAudio](#iaudioplayer-broaudio) - [Release Notes | BroAudio](#release-notes-broaudio) --- # Introduction | BroAudio ![Page cover](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1548504769-900b70ed122e%3Fcrop%3Dentropy%26cs%3Dsrgb%26fm%3Djpg%26ixid%3DM3wxOTcwMjR8MHwxfHNlYXJjaHw0fHxvcmFuZ2V8ZW58MHx8fHwxNzAzNDgwNjc1fDA%26ixlib%3Drb-4.0.3%26q%3D85&width=1248&dpr=3&quality=100&sign=25aa0f2a&sv=2) [hashtag](https://man572142s-organization.gitbook.io/broaudio#what-is-broaudio) **What is BroAudio?** ---------------------------------------------------------------------------------------------------------- BroAudio is a **sound management** and **playback system** designed for Unity. It's unique in its focus on [sound quality](https://man572142s-organization.gitbook.io/broaudio#why-is-this-tool-related-to-sound-quality) and a [developer-friendly](https://man572142s-organization.gitbook.io/broaudio#what-does-developer-friendly-mean-in-this-tool) experience. You can create extensive and captivating audio systems without the need for mastering complex middleware like FMOD or Wwise. Whether you're part of a large team or a solo developer, achieving the goals becomes effortless and efficient with BroAudio ### [hashtag](https://man572142s-organization.gitbook.io/broaudio#why-is-this-tool-related-to-sound-quality) Why is this tool related to sound quality? Indeed, apart from issues like noise and distortion that need to be repaired, there is no objective method to enhance sound quality. However, a playback system still holds significant impact over the quality of sound. This is because the loss of sound quality is relatively easy to occur and hard to avoid. Here are some common issues listed along with how BroAudio addresses them: Issues Bro's Solutions [Clipping](https://man572142s-organization.gitbook.io/broaudio/reference/audio-terminology#clipping) (distortion) caused by playing multiple sounds simultaneously Well-designed mixer and auto-ducking on the master track [Comb Filtering](https://man572142s-organization.gitbook.io/broaudio/reference/audio-terminology#comb-filtering) Preventing rapid repetition of the same sound Unbalanced volume levels Full range (-80dB to +20dB) and highly adaptable real-time volume control system Unnatural volume changes in Fade In, Fade Out and CrossFade Utilizing AudioMixer for volume control ### [hashtag](https://man572142s-organization.gitbook.io/broaudio#what-does-developer-friendly-mean-in-this-tool) What does Developer-Friendly mean in this tool? BroAudio aims to minimize the amount of information presented to developers. This means that by default, you will only see a few commonly used features, while other functions dynamically appear in the UI interface as you interact. You won't be overwhelmed by a large number of rarely used, or even completely unfamiliar settings and parameters. What's even better is that BroAudio allows you to customize the GUI layout. You can set and select the parameters you want to display in [_**Tools > BroAudio > Preferences**_](https://man572142s-organization.gitbook.io/broaudio/core-features/customization#gui) **.** ### [hashtag](https://man572142s-organization.gitbook.io/broaudio#can-i-still-use-unitys-built-in-audio-features) **Can I still use Unity's built-in audio features?** Yes, BroAudio is an add-on plugin, all of Unity's built-in audio features are still available. However, you might notice that BroAudio's AudioMixer and AudioSource have been fully integrated and wrapped, making customization a bit tricky. Indeed, that's the case. So, if there are features you need that BroAudio doesn't provide, I suggest keeping the existing BroAudio setup and creating separate AudioMixer and AudioSource instances. Implement the additional functionalities on these new instances. They can 100% work simultaneously with BroAudio. [hashtag](https://man572142s-organization.gitbook.io/broaudio#main-features) Main Features ----------------------------------------------------------------------------------------------- * Fade In/Out and Crossfade with multiple ease function * Seamless Looping * Random Playback (with weight), Sequential Playback * [SpectrumAnalyzer](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/spectrum-analyzer) for audio visualization * [SoundVolume](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/sound-volume) for instant game configuration * [Clip Editor](https://man572142s-organization.gitbook.io/broaudio/tools/clip-editor) for permanent audio clip editing * Supports **Unity Addressables** * Dynamic audio effects * Enhanced Volume Control Range (up to +20dB) * Visualized waveform and visualized playback flow view * Customizable GUI settings * Simple one-line code integration * and more… Last updated 9 months ago --- # Getting Started | BroAudio [hashtag](https://man572142s-organization.gitbook.io/broaudio/overview/getting-started#install) Install ------------------------------------------------------------------------------------------------------------ Get it from [Unity Asset Storearrow-up-right](https://assetstore.unity.com/packages/tools/audio/bro-audio-257362) , install it from Package Manager [hashtag](https://man572142s-organization.gitbook.io/broaudio/overview/getting-started#creating-sound-libraries) Creating sound libraries ---------------------------------------------------------------------------------------------------------------------------------------------- * **Locate** _**Tools > BroAudio > Library Manager**_ **in the Unity menu bar.** * **Drag and drop the required AudioClip.** ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252FIE7ysBjvZkHApbQs39cK%252FDragNDrop.gif%3Falt%3Dmedia%26token%3D27c80f8b-8e0c-4333-9003-ae1ee0a68b0a&width=768&dpr=3&quality=100&sign=6a24498f&sv=2) If multiple clips are dropped, a confirmation window will appear, asking how you would like to structure them. * **Edit the parameters** edit the clip's volume, playback position... etc. * **Name the asset and entities and choose an** [**AudioType**](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/broaudiotype) You could also skip this step. Just remember to set it before you need them in your scene. [hashtag](https://man572142s-organization.gitbook.io/broaudio/overview/getting-started#implementation) Implementation -------------------------------------------------------------------------------------------------------------------------- You can implement the sound you've created in Library Manager with or without coding. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/overview/getting-started#without-code) Without Code * **Add** ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252Ftl67dqZjUj5nZH0CG5dk%252FBroAudio_Logo_900x900.png%3Falt%3Dmedia%26token%3D0a17611a-aada-4eee-853e-4e00379469c8&width=40&dpr=3&quality=100&sign=61d9dd41&sv=2)**SoundSource component to a game object** * **Select the required sound via the dropdown menu** ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252FL6ysT8NV3kDCNG8BoB9A%252FUnity_VVf8IWAV8o.gif%3Falt%3Dmedia%26token%3D94af1bae-086b-453c-8732-d2255deb6577&width=768&dpr=3&quality=100&sign=8e88f10c&sv=2) * **Choose the triggering strategy** Enables "Play On Start" if you want to play it when the game object is activated at runtime. Or using [UnityEventarrow-up-right](https://docs.unity3d.com/2022.3/Documentation/Manual/UnityEvents.html) to trigger the Play() function like the Button's OnClick as below. ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252FvJKy6u4NNZWd1fYMDHIs%252FTriggerByUnityEvent.png%3Falt%3Dmedia%26token%3Da09aa014-2e3e-4f8b-b5ca-617dc7b05e51&width=768&dpr=3&quality=100&sign=1f0daac&sv=2) ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/overview/getting-started#with-code) With Code * **Declare a** [**SoundID**](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager#soundid) **and implement** `**BroAudio.Play()**` **to play it** ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252Fq9iuTTM70cD2urGbBuDW%252FBasicAPI2.png%3Falt%3Dmedia%26token%3D30d39bd0-4390-4ca8-ae13-d1ae64ea4a38&width=768&dpr=3&quality=100&sign=aedcb249&sv=2) * **Select the required sound via the dropdown menu in the Inspector** The same way as using [SoundSource](https://man572142s-organization.gitbook.io/broaudio/overview/getting-started#implementation-no-code) . [hashtag](https://man572142s-organization.gitbook.io/broaudio/overview/getting-started#hit-the-play-button-and-enjoy-it) Hit the play button and enjoy it! --------------------------------------------------------------------------------------------------------------------------------------------------------------- That's all you need to start using BroAudio. Of course, there is more than just this. Check out the rest of the documentation to fully unlock all the features of BroAudio. Last updated 9 months ago --- # Sound Volume | BroAudio ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252F2XsSV2MXd3dYOwbM8D23%252FUnity_hiLj6XkKp2.png%3Falt%3Dmedia%26token%3D3c5725bb-c27a-419a-bfea-1119008423ca&width=768&dpr=3&quality=100&sign=1156aa2&sv=2) circle-info This component is particularly useful in the following situations 1. **Slider Binding**: Easily bind this component to a [UI sliderarrow-up-right](https://docs.unity3d.com/2022.3/Documentation/Manual/script-Slider.html) to quickly implement volume control for your game. 2. **Quick Volume Adjustment**: Temporarily adjust the volume of a specific audio type when an event occurs by enabling or disabling this component. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/sound-volume#apply-on-enable) Apply On Enable ------------------------------------------------------------------------------------------------------------------------------------------------- Check this box to automatically apply the volume setting whenever the GameObject is enabled. **Only Apply Once:** Applies the settings only the first time the GameObject is enabled. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/sound-volume#reset-on-disable) Reset On Disable --------------------------------------------------------------------------------------------------------------------------------------------------- Check this box to automatically reset the volume back to the time before onEnable when the GameObject is disabled. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/sound-volume#fade-time) Fade Time ------------------------------------------------------------------------------------------------------------------------------------- The duration it takes to reach the target volume. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/sound-volume#slider) Slider ------------------------------------------------------------------------------------------------------------------------------- **Allow Boost:** Check this box to allow volumes beyond 0dB. **Slider Type:** Determines the scale of the slider, which will also affect the [UnityEngine.UI.Sliderarrow-up-right](https://docs.unity3d.com/2022.3/Documentation/Manual/script-Slider.html) assigned in the Volumes list below. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/sound-volume#volumes) Volumes --------------------------------------------------------------------------------------------------------------------------------- **Audio Type:** The target audio type to apply the volume to. You can select multiple types or set it to 'Everything' to act as a master volume control. **Slider(optional):** The [Unity UI Sliderarrow-up-right](https://docs.unity3d.com/2022.3/Documentation/Manual/script-Slider.html) component that syncs with the volume. **Volume:** The volume level. **\[Read\]** **button****:** Converts the UI Slider value to volume. **\[Set\]** **button****:** Converts the volume to the UI Slider value. **\[Edit in Playmode\]** **button****:** Available in Playmode. If enabled, the volume applies directly to the system, useful for debugging. Last updated 1 year ago --- # Editor Audio Preview | BroAudio [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/editor-audio-preview#introduction) Introduction -------------------------------------------------------------------------------------------------------------------------------- Playtesting is an important but time-consuming part of development. That’s why it's crucial to be able to preview your work without having to enter the game every time. BroAudio provides several ways to preview your audio along with the settings you've configured for it, helping you speed up iteration during development. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/editor-audio-preview#ground-rules) Ground Rules -------------------------------------------------------------------------------------------------------------------------------- There are two main ways to preview audio in the editor: * **Left Click** – Plays the audio using the settings you've set up in BroAudio (e.g. volume, pitch). * **Right Click** – Plays the raw audio clip directly, ignoring all configurations. These two methods apply to all preview features in BroAudio, whether you're clicking a play button or interacting with the waveform view. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/editor-audio-preview#library-manager) Library Manager -------------------------------------------------------------------------------------------------------------------------------------- ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252FepOCyKLiIFOxwrQ31NON%252FEditorAudioPreview.png%3Falt%3Dmedia%26token%3Dd90b0598-88b9-4def-bef3-ea74b853fc42&width=768&dpr=3&quality=100&sign=c254f087&sv=2) #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/editor-audio-preview#entity-preview) Entity Preview At the top of each [audio entity](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager#entity) , you'll find the entity preview buttons. ▶️ When you click the play button: 1. It selects one of the audio clips based on the current [**Play Mode**](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#playmode) setting. 2. It plays the clip using the volume and pitch settings you've configured (`clip volume × master volume`). 🔁 If the replay button is toggled **on**, it will continuously replay the audio. This replay isn’t just a simple loop, **it works like triggering the sound repeatedly in the game**. So if your volume or pitch is set to [**Random**](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/randomization) , you’ll hear different results each time. The clip might also change depending on how your [**Play Mode**](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#playmode) is set up. #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/editor-audio-preview#clip-preview) Clip Preview Each clip has its own play button for previewing. Clicking it will preview that specific clip and ignore the [Play Mode](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#playmode) setting. #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/editor-audio-preview#waveform-view) Waveform View You can click directly on the waveform view to play the audio from the exact position you clicked. It will continue playing until the end of the clip. ⚠ Start Position, End Position, Fade In, and Fade Out settings will be ignored during this preview. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/editor-audio-preview#soundid-field) SoundID Field ---------------------------------------------------------------------------------------------------------------------------------- ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252FEVccB8qGaqMvVloR0p1X%252Fimage.png%3Falt%3Dmedia%26token%3D95d3a6be-7474-4c0c-bad1-c8091b86a534&width=768&dpr=3&quality=100&sign=e43e6150&sv=2) For every [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) field in the inspector, a play button appears next to the dropdown. Clicking it previews the [audio entity](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager#entity) that the SoundID refers to. It behaves the same as pressing the entity preview play button in the Library Manager, just without the replay. Last updated 6 months ago --- # Library Manager | BroAudio ![Page cover](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252FUhzDSjEL4KixTmABleCK%252FUnity_j0cQdDpL3G.png%3Falt%3Dmedia%26token%3Db16a7854-259a-492a-83e8-104a0f78ba46&width=1248&dpr=3&quality=100&sign=389602b7&sv=2) The library is primarily composed of two data structures: **Asset** and **Entity**. Their relationship is illustrated in the following diagram: ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252FLkfsBWWYy9AM51QeYmam%252FDataStructure.png%3Falt%3Dmedia%26token%3D225ba472-0e9a-42b0-9c1d-6f3a6c134498&width=768&dpr=3&quality=100&sign=d539b4d1&sv=2) [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager#asset) Asset ------------------------------------------------------------------------------------------------------------- Asset is a [ScriptableObjectarrow-up-right](https://docs.unity3d.com/Manual/class-ScriptableObject.html) that contains a collection of Entities. You can group commonly used sounds together in the same Asset. As you can see in the diagram above, all sounds related to the "Player" are stored within the Player Asset. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager#entity) **Entity** ------------------------------------------------------------------------------------------------------------------- An Entity represents a single sound, so when it is played, only one AudioClip from its [ClipList](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#clip-list) will be played. Here, we set which AudioClip it should play, how it should be played, and what kind of characteristic it will have during playback. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager#soundid) SoundID When an entity is created in the LibraryManager, a SoundID is automatically generated. Once the SoundID is serialized (by \[SerializedField\] or public), a dropdown menu appears in the inspector. [see how to do this in action](https://man572142s-organization.gitbook.io/broaudio/overview/getting-started#declare-an-audioid-and-use-broaudio.play-to-play-it) Last updated 1 year ago --- # Compatibility | BroAudio [hashtag](https://man572142s-organization.gitbook.io/broaudio/overview/compatibility#unity-version) Unity Version ---------------------------------------------------------------------------------------------------------------------- BroAudio works on Unity 2020.3+, including 2020.3, 2020.3, 2021, 2022, 2023 and Unity 6 [hashtag](https://man572142s-organization.gitbook.io/broaudio/overview/compatibility#platform) Platform ------------------------------------------------------------------------------------------------------------ Platform Tested Limitation PC ✅ ❌ Mac ✅ ❌ Android ✅ ❌ iOS ✅ ❌ WebGL ✅ [see below](https://man572142s-organization.gitbook.io/broaudio/overview/compatibility#webgl) Console (Playstation, Xbox, Switch...) ❌ unknown ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/overview/compatibility#webgl) WebGL Audio in WebGL is heavily limited in Unity, since BroAudio is an add-on plugin based on Unity Audio, many features are limited as well. List of the BroAudio features that are **not supported** in WebGL. * [Dominator Player](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/dominator-player) * [AudioEffect](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-effect) List of the BroAudio features that are **limited** in WebGL. * [Volume](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/volume-control) range will be limited to 0~1 (-80dB ~ 0dB) * [Fading](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/fade-in-out-and-cross-fade) will **not** be frame rate independent circle-info Most of the listed feature limitations are due to the lack of support for AudioMixer, which is only mentioned on the [AudioMixerarrow-up-right](https://docs.unity3d.com/Manual/AudioMixer.html) page. For more information about Audio in WebGL, see [Unity Docsarrow-up-right](https://docs.unity3d.com/Manual/webgl-audio.html) Last updated 8 months ago --- # Scripting API | BroAudio ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation#the-method-chaining-design) The Method Chaining design BroAudio utilizes the Method Chaining design, just like the [System.Linq in C#arrow-up-right](https://learn.microsoft.com/en-us/dotnet/csharp/linq/get-started/write-linq-queries) , you can chain one method with another method, adding behaviors and settings in just one line of code. For example: Copy BroAudio.Play(_sound).AsBGM().SetTransition(Transition.CrossFade).SetVolume(0.8f); More Information in the Class/[BroAudio](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio) , and Interface/[IAudioPlayer](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer) section. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation#page-links) Page Links [Classchevron-right](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class) [Interfacechevron-right](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface) [Structchevron-right](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct) [Enumschevron-right](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums) Last updated 26 days ago --- # Spectrum Analyzer | BroAudio ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252FJoAYufpWd8qFjqQK8qky%252FSpectrumAnalyzer.png%3Falt%3Dmedia%26token%3Daad7ecf5-cb15-4653-836e-36c582aa7533&width=768&dpr=3&quality=100&sign=a45282d1&sv=2) ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/spectrum-analyzer#sound-source) Sound Source Assign a SoundSource here to obtain spectrum data when it plays. This field is optional, meaning it can be left **null**, and the spectrum data source can be set via code at runtime. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/spectrum-analyzer#fft-settings) FFT Settings ------------------------------------------------------------------------------------------------------------------------------------------------ FFT (_Fast Fourier Transform_) is an algorithm used to extract frequency information from a signal. A larger size provides better precision but comes at a higher performance cost. **Block Size** Number of data samples used for FFT, which can also be considered as frequency resolution. The bigger the size is, the better precision, but also higher performance cost. **Window Type** The [FFTWindowarrow-up-right](https://docs.unity3d.com/6000.0/Documentation/ScriptReference/FFTWindow.html) type to use when sampling. **Channel** The target channel from which the spectrum is sampled. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/spectrum-analyzer#amplitube-settings) Amplitube Settings ------------------------------------------------------------------------------------------------------------------------------------------------------------ Instead of using raw spectrum data, BroAudio processes it into **amplitudes** for easier use and better readability. **Metering** The metering type used to calculate the amplitude of each band during updates. **Attack** The time it takes to **raise** a level of 20dB in milliseconds **Decay** The time it takes to **reduce** a level of 20dB in milliseconds **Smooth** Increase this value to smooth the spectrum changes. The higher the value, the smoother it becomes [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/spectrum-analyzer#bands) Bands ---------------------------------------------------------------------------------------------------------------------------------- Defines the frequency bands used for analysis. ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252F6vRrF59fJ6zprChrEk5o%252Fpreview.gif%3Falt%3Dmedia%26token%3D4f301a33-fd3e-401b-a619-32daa60204a8&width=768&dpr=3&quality=100&sign=821070c9&sv=2) **Frequency** The starting frequency of the band. You can either enter a value manually or adjust it by dragging the lines in the spectrum view above. **Weight** Adjusts the band's response sensitivity, allowing you to emphasize certain frequencies. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/spectrum-analyzer#public-methods) Public Methods ---------------------------------------------------------------------------------------------------------------------------------------------------- Method Return Parameters Description **SetSource** void [IAudioPlayer](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer) Set the source for fetching spectrum datas. It should be called when the [SoundSource](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/spectrum-analyzer#sound-source) field is empty. Last updated 12 months ago --- # Create The Library | BroAudio ![Page cover](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1542208998-f6dbbb27a72f%3Fcrop%3Dentropy%26cs%3Dsrgb%26fm%3Djpg%26ixid%3DM3wxOTcwMjR8MHwxfHNlYXJjaHwxfHxyZWNvcmQlMjBzdG9yZXxlbnwwfHx8fDE3MDk4Nzc0NzV8MA%26ixlib%3Drb-4.0.3%26q%3D85&width=1248&dpr=3&quality=100&sign=6c94d100&sv=2) When you open the Library Manager, you will see the two major sections of the library creation. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/create-the-library#drag-and-drop-or-browse) Drag And Drop or Browse -------------------------------------------------------------------------------------------------------------------------------------------------------------------- This is pretty straightforward, you can bring any AudioClip into the library by drag and drop or browse. It will create an [Asset](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager#asset) and one (or more) [Entity](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager#entity) automatically. If multiple AudioClips are dropped. A confirmation window will pop up to ask you how you would like to structure them, these options are: **1\. Multiple For Each:** Create multiple entities for each audio clip. **2\. One For All:** Create one entity and add all the audio clips to the entity's clip list. circle-info When an asset is created in this way, it is automatically named "Temp". You can start editing right away. However, if you want to use it in play mode, remember to give it an official name. You can change the name by clicking "Temp" at the top left. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/create-the-library#asset-list) Asset List ------------------------------------------------------------------------------------------------------------------------------------------ If you have created any assets before, they will appear in the list. You can access the asset to modify its content by **double-clicking** it. The asset list works like an ordinary list shown in the inspector but with slightly different consequences from the action below. **Add(+):** A naming window will pop up first. Once the naming is completed, an element and an Asset ([ScriptableObjectarrow-up-right](https://docs.unity3d.com/Manual/class-ScriptableObject.html) ) will be created. circle-info The default file path for the asset is _Assets/BroAudio/AudioAssets_. If you want to change the path, you can do so in the last tab of [_**Tools > BroAudio > Preferences**_](https://man572142s-organization.gitbook.io/broaudio/core-features/customization#misc) _._ **Remove(-):** It will remove both the element in the list, and the asset file it's referring to. Last updated 9 months ago * [Drag And Drop or Browse](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/create-the-library#drag-and-drop-or-browse) * [Asset List](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/create-the-library#asset-list) sun-brightdesktopmoon sun-brightdesktopmoon --- # Volume | BroAudio ![Page cover](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1516865674991-9bb4878e3476%3Fcrop%3Dentropy%26cs%3Dsrgb%26fm%3Djpg%26ixid%3DM3wxOTcwMjR8MHwxfHNlYXJjaHwxfHx2b2x1bWV8ZW58MHx8fHwxNzA0Mjc3ODc2fDA%26ixlib%3Drb-4.0.3%26q%3D85&width=1248&dpr=3&quality=100&sign=8d8d65e1&sv=2) [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/volume-control#volume-unit) Volume Unit --------------------------------------------------------------------------------------------------------------------------------------------------------- We often encounter two types of volume units in Unity and BroAudio, both relative to the original audio file's volume: 1. **Normalized Volume:** When set to 1, it represents 100% of the file's original volume, while 0 represents 0% volume, which means complete silence. Unity's [AudioSourcearrow-up-right](https://docs.unity3d.com/Manual/class-AudioSource.html) volume uses this unit. 2. **Decibel Volume (dB):** This is the most commonly used unit to describe volume. It represents a logarithmic value. When set to 0dB, it means no changes to the file's original volume (so 0dB = 1 normalized volume). Unity's [AudioMixerarrow-up-right](https://docs.unity3d.com/Manual/AudioMixer.html) uses this unit. [Decibel(dB) Wikipediaarrow-up-right](https://en.wikipedia.org/wiki/Decibel) circle-info Decibel (dB) is a relative unit, so different reference objects and ranges can lead to different calculations. However, here we are referring to **dBFS**, which uses the original volume of the audio file as its Full Scale. These two volume units can be converted into each other. Although **you don't need to do the calculations** yourself, if you are interested, the formula is as follows: dB\=20log(V1/V2)dB = 20log (V1/V2)dB\=20log(V1/V2) (V1/V2) is the same as Normalized Volume. There are many simple [online calculatorsarrow-up-right](https://daycounter.com/Calculators/Decibels-Calculator.phtml) available for use. By entering the Normalized Volume into the Voltage Gain, you can convert it to dB. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/volume-control#volume-range) Volume Range ----------------------------------------------------------------------------------------------------------------------------------------------------------- In BroAudio, every sound plays through the [Audio Mixer](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer) , with a volume range of 0 to 10 (-80dB to +20dB). This is **20dB more** than what [Audio Sourcearrow-up-right](https://docs.unity3d.com/Manual/class-AudioSource.html) offers, meaning you can produce sounds louder than the original files. This feature helps you to easily adjust and balance the overall volume. circle-exclamation Volume range will be limited to 0~1 (-80dB~0dB) in WebGL, [more details.](https://man572142s-organization.gitbook.io/broaudio/overview/compatibility#webgl) [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/volume-control#editor-slider) Editor Slider ------------------------------------------------------------------------------------------------------------------------------------------------------------- The volume slider is based on decibel value; it's a logarithmic slider instead of a linear slider like [Audio Sourcearrow-up-right](https://docs.unity3d.com/Manual/class-AudioSource.html) 's volume. This matches human sound perception better and allows for easier fine-tuning. To further ensure precision, most audio software, including [Unity Audio Mixerarrow-up-right](https://docs.unity3d.com/Manual/AudioMixer.html) , features custom scale settings. Below is a comparison of different slider types, with each measured in decibels(dB) : ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252FU9U9DmH0MM9PpmTEroPH%252FSlider%2520difference.PNG%3Falt%3Dmedia%26token%3D6a11f3ac-f8e3-4d86-8155-ff70b9a64415&width=768&dpr=3&quality=100&sign=4267f1ea&sv=2) \-6dB ≒ 0.5 volume (half volume), -20dB ≒ 0.1 volume, [Decibel(dB) Wikipediaarrow-up-right](https://en.wikipedia.org/wiki/Decibel) [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/volume-control#all-volume-settings-work-in-conjunction) All volume settings work in conjunction ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- There are four volume settings available in BroAudio, and they all work in conjunction. 1. [Clip Volume](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#clip-parameters) 2. [Master Volume](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#master-volume) (of the entity) 3. [BroAudio.SetVolume(SoundID)](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#operations) or [IAudioPlayer.SetVolume()](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#public-methods) 4. [BroAudio.SetVolume(BroAudioType)](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#operations) The final playback volume (in normalized) will be **Clip Volume** \* **Entity Master Volume** \* **TrackVolume**(if 3. was used) \* **AudioTypeVolume**(if 4. was used) Last updated 3 months ago * [Volume Unit](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/volume-control#volume-unit) * [Volume Range](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/volume-control#volume-range) * [Editor Slider](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/volume-control#editor-slider) * [All volume settings work in conjunction](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/volume-control#all-volume-settings-work-in-conjunction) sun-brightdesktopmoon sun-brightdesktopmoon --- # Fading | BroAudio ![Page cover](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1514241516423-6c0a5e031aa2%3Fcrop%3Dentropy%26cs%3Dsrgb%26fm%3Djpg%26ixid%3DM3wxOTcwMjR8MHwxfHNlYXJjaHwyfHxzdW5yaXNlfGVufDB8fHx8MTcwNDI3ODEyN3ww%26ixlib%3Drb-4.0.3%26q%3D85&width=1248&dpr=3&quality=100&sign=19f87f50&sv=2) [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/fade-in-out-and-cross-fade#introduction) Introduction ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/fade-in-out-and-cross-fade#fade-in-out) Fade In/Out Fade in and fade out are techniques that make the playback experience smoother and more fluid. In addition to setting these fading for each AudioClip in LibraryManager, you also have APIs like `SetVolume()` and `SetEffect()`that offer a fadeTime(float value) overload, allowing all changes to appear more natural. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/fade-in-out-and-cross-fade#cross-fade) Cross Fade Crossfading is the technique of smoothly transitioning from one sound to another by gradually decreasing the volume of the first sound while simultaneously increasing the volume of the second. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/fade-in-out-and-cross-fade#all-fadings-are-framerate-independent-in-broaudio) All fadings are framerate-independent in BroAudio ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- One of the main reasons BroAudio uses volume control through AudioMixer instead of AudioSource is that AudioMixer is frame rate independent, allowing volume changes to occur more naturally and precisely. If you're interested, there's an excellent [articlearrow-up-right](https://johnleonardfrench.com/how-to-fade-audio-in-unity-i-tested-every-method-this-ones-the-best/#first_method) that explains the differences between the two. circle-exclamation Fading in WebGL will still be framerate-dependent. [more details](https://man572142s-organization.gitbook.io/broaudio/overview/compatibility#webgl) Last updated 1 year ago * [Introduction](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/fade-in-out-and-cross-fade#introduction) * [Fade In/Out](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/fade-in-out-and-cross-fade#fade-in-out) * [Cross Fade](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/fade-in-out-and-cross-fade#cross-fade) * [All fadings are framerate-independent in BroAudio](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/fade-in-out-and-cross-fade#all-fadings-are-framerate-independent-in-broaudio) sun-brightdesktopmoon sun-brightdesktopmoon --- # Randomization | BroAudio ![Page cover](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1596270893948-f493df7740f1%3Fcrop%3Dentropy%26cs%3Dsrgb%26fm%3Djpg%26ixid%3DM3wxOTcwMjR8MHwxfHNlYXJjaHw1fHxkaWNlfGVufDB8fHx8MTcxMTAwNDIxMnww%26ixlib%3Drb-4.0.3%26q%3D85&width=1248&dpr=3&quality=100&sign=d7dcf1a6&sv=2) [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/randomization#introduction) Introduction ---------------------------------------------------------------------------------------------------------------------------------------------------------- To create a game with exceptional immersion and rich, vivid sound effects, using a vast sound library is one option. However, finding suitable and sufficiently varied sounds can be challenging, and employing numerous audio files can significantly increase the game's size. Therefore, the ideal approach is simply to use randomization. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/randomization#how-to-use) How To Use? ------------------------------------------------------------------------------------------------------------------------------------------------------- BroAudio provides numerous randomization methods, all of which can be configured in the [LibraryManager](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager) without writing any code. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/randomization#audio-clips) Audio Clips If an AudioEntity has more than one clip. You can set its [PlayMode](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#playmode) to 'Random'. It will randomly select one AudioClip based on its weight when it's played. Probability is calculated as _Weight/Total sum of all weights._ ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/randomization#volume) Volume Toggle the \[RND\] button next to the '[Master Volume](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#master-volume) ' setting in AudioEntity, and set the random range. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/randomization#pitch) Pitch Toggle the \[RND\] button next to the '[Pitch](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#pitch) ' setting in AudioEntity, and set the random range. Last updated 6 months ago * [Introduction](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/randomization#introduction) * [How To Use?](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/randomization#how-to-use) * [Audio Clips](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/randomization#audio-clips) * [Volume](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/randomization#volume) * [Pitch](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/randomization#pitch) sun-brightdesktopmoon sun-brightdesktopmoon --- # Looping | BroAudio ![Page cover](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1702360373665-af7bf9766ab4%3Fcrop%3Dentropy%26cs%3Dsrgb%26fm%3Djpg%26ixid%3DM3wxOTcwMjR8MHwxfHJhbmRvbXx8fHx8fHx8fDE3MDQyNzc4MjR8%26ixlib%3Drb-4.0.3%26q%3D85&width=1248&dpr=3&quality=100&sign=572f3956&sv=2) [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/seamless-loop#introduction) Introduction ---------------------------------------------------------------------------------------------------------------------------------------------------------- Looping allows an [AudioCliparrow-up-right](https://docs.unity3d.com/Manual/class-AudioClip.html) to be continuously replayed. It's a common technique used for playing sounds such as **Music** and **Ambience** in games. However, if a sound is not specifically designed for looping, its beginning and end might not match seamlessly. Direct replay would result in a noticeable change. This is where **SeamlessLoop** comes in. It enables an [AudioCliparrow-up-right](https://docs.unity3d.com/Manual/class-AudioClip.html) to start playing again on a new audio track just before the current one finishes. By gradually [cross-fading](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/fade-in-out-and-cross-fade#crossfade) between the two tracks, it creates an illusion that the sound never stops at all. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/seamless-loop#how-to-use) **How To Use?** ----------------------------------------------------------------------------------------------------------------------------------------------------------- You can find the **Looping** option in the 'Overall' tab of an AudioEntity. If one of the looping options is selected, the AudioEntity will play accordingly. Didn't see the option? ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252FntWz0dHfR4oOL1cauuE8%252FSeamlessLoop.png%3Falt%3Dmedia%26token%3D4149f7a4-4313-4975-8581-8b1835dca0d6&width=768&dpr=3&quality=100&sign=16a71d8b&sv=2) ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/seamless-loop#loop) Loop The sound will replay when it's finished. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/seamless-loop#seamless-loop) Seamless Loop The sound will replay **before** it ends. If this option is selected, "Seamless Setting" will appear, allowing you to set the transition timing. 1. **Clip Setting:** The replay begins as the clip starts fading out. 2. **Time:** The replay starts a specified number of seconds before the end. 3. **Tempo:** The replay starts a specified number of beats before the end. Last updated 1 year ago * [Introduction](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/seamless-loop#introduction) * [How To Use?](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/seamless-loop#how-to-use) * [Loop](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/seamless-loop#loop) * [Seamless Loop](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/seamless-loop#seamless-loop) sun-brightdesktopmoon sun-brightdesktopmoon --- # Velocity | BroAudio ![Page cover](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1529982840618-3ec6ead42f33%3Fcrop%3Dentropy%26cs%3Dsrgb%26fm%3Djpg%26ixid%3DM3wxOTcwMjR8MHwxfHNlYXJjaHwxfHxpbXBhY3R8ZW58MHx8fHwxNzI3NzYwNzUyfDA%26ixlib%3Drb-4.0.3%26q%3D85&width=1248&dpr=3&quality=100&sign=72da0b4&sv=2) [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/velocity#introduction) Introduction ----------------------------------------------------------------------------------------------------------------------------------------------------- Velocity helps determine which clip should be played in a given scenario. The concept originates from the MIDI keyboards in music production world. These devices capture the [velocity arrow-up-right](https://youtu.be/EjCPiVFwZfQ?si=N5moA_od9JvAOCz-) (the force with which a note is played) and use it to trigger different audio samples based on this value. This feature was designed in a similar way. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/velocity#how-to-use) How To Use? -------------------------------------------------------------------------------------------------------------------------------------------------- Set the [PlayMode](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#playmode) to **Velocity** and set the value for each clip from low to high. These values will then be used as the bottom of a certain velocity range. Say if you have 2 clips set as 0 and 50, when the given velocity is 30, the first clip will be played, and if the given velocity is 60, the second clip will be played. To give a velocity, simplicity just add [.SetVelocity(velocity)](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#public-methods) to the [method chain](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation#the-method-chaining-design) . Copy BroAudio.Play(_hit).SetVelocity(60); Last updated 6 months ago * [Introduction](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/velocity#introduction) * [How To Use?](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/velocity#how-to-use) sun-brightdesktopmoon sun-brightdesktopmoon --- # Design The Sound | BroAudio ![Page cover](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1680026548022-e76f693d0a62%3Fcrop%3Dentropy%26cs%3Dsrgb%26fm%3Djpg%26ixid%3DM3wxOTcwMjR8MHwxfHNlYXJjaHw0fHx3YXZlZm9ybXxlbnwwfHx8fDE3MDk4ODYxMzJ8MA%26ixlib%3Drb-4.0.3%26q%3D85&width=1248&dpr=3&quality=100&sign=4fa17254&sv=2) [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#name) Name ---------------------------------------------------------------------------------------------------------------------------- Click the text field to name the entity when it's unfolded. 🔔The name will be used in the SoundID dropdown menu, so a meaningful name is recommended. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#bro-audio-type) Bro Audio Type ------------------------------------------------------------------------------------------------------------------------------------------------ The AudioType of the entity, it can be utilized by the API such as SetVolume(AudioType) or SetEffect(AudioType) ...etc. Choose the type that suits your needs. 🔔Changing the AudioType will re-generate a new SoundID, which means the reference to this entity that you've saved in your scene or scriptable object will be gone. circle-check All settings and features in LibraryManager can be utilized without the need for any coding or API usage. Such as [randomization](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/randomization) , [fading](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/fade-in-out-and-cross-fade) , [seamless loop](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#looping) ...etc. 🎵Clips ✨Overall ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#clip-list) Clip List The list that stores all the Audio Clips. Each clip can have different parameter settings, and they will be picked by the PlaybackMode setting when it's played at runtime. The parameters will be shown when one of the clips is selected. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#playmode) PlayMode When an entity is played, it will follow the rule of the following options to pick an Audio Clip. 1. **Single:** always play the first AudioClip. 2. **Sequence:** The first playback will be at index 0, the second will be at index 1, and so on. After playing the last AudioClip, the next playback will return to index 0. 3. [**Random**](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/randomization#audio-clips) **:** It will randomly select one AudioClip based on its weight. Probability is calculated as _Weight/Total sum of all weights._ 4. [**Shuffle**](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/randomization#audio-clips) **:** Plays audio clips randomly, ensuring that no clip is repeated until all clips in the list have been played. 5. [**Velocity**](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/velocity) **:** Play clip by the specified number. 6. [**Chained**](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/chained-playback) : Plays a start sound when triggered, then loops a base sound. An end sound is played when stopped. 🔔 if there is only one AudioClip, the options won't show, and it will use **Single** mode ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#clip-parameters) Clip Parameters **Volume** The audio volume that the clip will be played. More details on the [Volume](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/volume-control) page. #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#playback-position-in-seconds) Playback Position (in seconds) **Start:** The starting point of the clip. **End:** The ending point of the clip. **In:** The duration time of the fade-in process. **Out:** The duration time of the fade-out process. **Delay:** The duration time before the entity plays. circle-check The playback position can be controlled by dragging the icon on the waveform GUI, and the green guiding line could help you see the playback flow more clearly. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#master-volume) Master Volume The audio volume that the entity will be played. It is useful when using multiple clips in an entity. More details on the [Volume](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/volume-control) page. ✅This setting supports 🎲 [Randomization](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/randomization) ! Click the \[RND\] button to set its random range. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#pitch) Pitch The pitch of the entity. Currently, it is the same as AudioSource's pitch, which is achieved through time stretching. The higher the pitch is set, the more it is shortened. ✅This setting supports 🎲 [Randomization](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/randomization) ! Click the \[RND\] button to set its random range. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#priority) Priority The same as AudioSource's priority. [see Unity's Docarrow-up-right](https://docs.unity3d.com/Manual/class-AudioSource.html) ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#looping) Looping Let the entity automatically replay when it ends. More details in [Seamless Loop](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/seamless-loop) . ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#spatial) Spatial The same as AudioSource's 3D Sound Settings ([see Unity's Docarrow-up-right](https://docs.unity3d.com/Manual/class-AudioSource.html) ), but it's optional instead of built-in in all entities. If the sound needs positioning, then click the \[Create And Open\] button to create a spatial setting asset and open its editor window. _Tips: Sounds that might not needed: BGM, Ambience, UI, VoiceOver. Sounds that might needed: SFX_ circle-info **Alt** \+ **Left-Click** on the foldout icon of any entity can expand/collapse all the entities quickly. Last updated 6 months ago * [Name](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#name) * [Bro Audio Type](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#bro-audio-type) sun-brightdesktopmoon sun-brightdesktopmoon --- # No-Code Components | BroAudio [Sound Sourcechevron-right](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/sound-source) [Sound Volumechevron-right](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/sound-volume) [Spectrum Analyzerchevron-right](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/spectrum-analyzer) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Audio Player | BroAudio [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player#introduction) Introduction ------------------------------------------------------------------------------------------------------------------------ Audio Player is the base object that is used to play audio. It's a GameObject that contains an [AudioSourcearrow-up-right](https://docs.unity3d.com/ScriptReference/AudioSource.html) component and spawns in the scene when needed. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player#how-to-use) How To Use? --------------------------------------------------------------------------------------------------------------------- Simply just use the [SoundSource](https://man572142s-organization.gitbook.io/broaudio/overview/getting-started#without-code) component or call the [BroAudio.Play(\_soundID)](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#playback) API in your script. Bro will instantiate an AudioPlayer and automatically set all the properties you configured in the [LibraryManager](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager) to its AudioSource component. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player#control-the-audioplayer) Control the AudioPlayer #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player#play-by-soundsource-component) Play by ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252Ftl67dqZjUj5nZH0CG5dk%252FBroAudio_Logo_900x900.png%3Falt%3Dmedia%26token%3D0a17611a-aada-4eee-853e-4e00379469c8&width=40&dpr=3&quality=100&sign=61d9dd41&sv=2)SoundSource component SoundSource component has many public methods that could be used with [UnityEventsarrow-up-right](https://docs.unity3d.com/Manual/UnityEvents.html) , like the example on the [Getting Started](https://man572142s-organization.gitbook.io/broaudio/overview/getting-started#without-code) page, you can assign methods like `SetVolume()`, or `Stop()` when a certain event is triggered. #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player#play-by-script-api) Play by script (API) When you call `BroAudio.Play(_soundID)`, a value of type [IAudioPlayer](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer) is returned. It represents the instance of AudioPlayer, and you can cache it to execute other APIs (like `SetVolume()`, `Stop()`...etc) when needed. While the above approaches help you control the AudioPlayer easily, there's one thing to be aware of: Object Pooling. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player#object-pool) Object Pool ---------------------------------------------------------------------------------------------------------------------- Object pool is a common performance optimization strategy in software engineering, especially in game development, it minimizes the CPU cost of frequent creation and memory usage by reusing objects in a limited pool. Using object pooling with the AudioPlayer is necessary due to the frequent changes in the amount of sound in games. **In BroAudio, once the audio finishes playing, it is recycled into the pool, waiting to be reused.** ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player#accessing-a-recycled-audioplayer) Accessing a recycled AudioPlayer? Under the object pooling design, a drawback is that if you cache the reference of AudioPlayer (via IAudioPlayer or any other type), you might access an AudioPlayer that has finished playing and has been recycled or even reused by other sounds. Don't worry, Bro has got your back! This issue has been resolved since [ver 1.04](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#version-1.04-unity-asset-store) . If you try to access a recycled AudioPlayer, instead of encountering errors or getting a wrong player, the execution will be canceled, and a warning will be logged to the console. You can also set whether to log this warning in _Tools > BroAudio > Preferences_. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player#play-audio-across-scenes) Play Audio Across Scenes ------------------------------------------------------------------------------------------------------------------------------------------------ When the first scene is loaded, BroAudio will automatically create a singleton sound manager object and set it to [DontDestoryOnLoadarrow-up-right](https://docs.unity3d.com/ScriptReference/Object.DontDestroyOnLoad.html) . The sound manager will be the parent of all AudioPlayers, and since it is not destroyed when loading a new scene, the AudioPlayers persist as well. Therefore, all audio will not be interrupted and can continue playing across multiple scenes. This design offers more possibilities for the game's audio management. For example, you can allow the same music to keep playing across scenes, create a smooth ambience sound transition when the scene change, or make the SFXs from the previous scene naturally fade out without a sudden stop. circle-info If there is a need to stop all sounds when the scene changes or restarts, use `BroAudio.Stop(BroAudioType.All)` [API](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#public-methods) . Last updated 3 months ago * [Introduction](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player#introduction) * [How To Use?](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player#how-to-use) * [Control the AudioPlayer](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player#control-the-audioplayer) * [Object Pool](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player#object-pool) * [Accessing a recycled AudioPlayer?](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player#accessing-a-recycled-audioplayer) * [Play Audio Across Scenes](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player#play-audio-across-scenes) sun-brightdesktopmoon sun-brightdesktopmoon --- # Sound Source | BroAudio ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252FetbLnNfS8o52keSQggeb%252FUnity_G7QHvYRN1u.png%3Falt%3Dmedia%26token%3D3bc07947-f890-4555-ba72-254cb0c9905a&width=768&dpr=3&quality=100&sign=542fae5d&sv=2) [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/sound-source#play-on-enable) Play On Enable ----------------------------------------------------------------------------------------------------------------------------------------------- Check this box to automatically play the sound whenever the GameObject is enabled. **Only Play Once:** Plays the sound only the first time the GameObject is enabled. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/sound-source#stop-on-disable) Stop On Disable ------------------------------------------------------------------------------------------------------------------------------------------------- Check this box to automatically stop the sound whenever the GameObject is disabled. **Override Fade Out:** Check this box to override the fade-out time setting when stopping the sound on disable. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/sound-source#sound) Sound ----------------------------------------------------------------------------------------------------------------------------- The sound to play. You can select the required sound via the dropdown menu. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/sound-source#position-mode) Position Mode --------------------------------------------------------------------------------------------------------------------------------------------- Determines the sound's location when triggered. * **Global**: Plays globally (2D), meaning the sound can be heard everywhere. * **Stay Here:** Plays as a 3D sound and stays where the GameObject is located. * **Follow Target:** Plays as a 3D sound and follows the GameObject as it moves. Last updated 11 months ago * [Play On Enable](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/sound-source#play-on-enable) * [Stop On Disable](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/sound-source#stop-on-disable) * [Sound](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/sound-source#sound) * [Position Mode](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/sound-source#position-mode) sun-brightdesktopmoon sun-brightdesktopmoon --- # Dominator Player | BroAudio ![Page cover](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1597243508456-d8cb4178de17%3Fcrop%3Dentropy%26cs%3Dsrgb%26fm%3Djpg%26ixid%3DM3wxOTcwMjR8MHwxfHNlYXJjaHw1fHxleHBsb3Npb258ZW58MHx8fHwxNzA5ODc3NzM5fDA%26ixlib%3Drb-4.0.3%26q%3D85&width=1248&dpr=3&quality=100&sign=68b6bf95&sv=2) [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/dominator-player#introduction) Introduction ----------------------------------------------------------------------------------------------------------------------------------------- Dominator allows you to 'dominate' other sounds while playing it, meaning Dominator will play in a normal way, while other sounds will be affected by the effects you specify until the Dominator is finished. circle-exclamation This feature is not supported in WebGL, [more details.](https://man572142s-organization.gitbook.io/broaudio/overview/compatibility#webgl) [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/dominator-player#how-to-use) How To Use? -------------------------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/dominator-player#asdominator) .AsDominator() Common use cases and API examples: #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/dominator-player#when-an-explosion-occurs-nearby-other-sounds-become-temporarily-unclear-but-the-tinnitus-heartbeat-o) When an explosion occurs nearby, other sounds become temporarily unclear, but the tinnitus, heartbeat, or breathing remain clear. Copy BroAudio.Play(_explosion).AsDominator().LowPassOthers(_lowPassFrequency); BroAudio.Play(_tinnitus).AsDominator().LowPassOthers(_lowPassFrequency); #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/dominator-player#when-the-theme-song-plays-lower-the-volume-of-all-other-sounds) When the theme song plays, lower the volume of all other sounds. Copy BroAudio.Play(_deathStrandingAwesomeMusic).AsDominator().QuietOthers(othersVol); [**Go to view all API**](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iplayereffect) ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/dominator-player#side-note) Side Note: Even though this feature is straightforward and effective, it might not cover all complex situations. For these, you can individually apply the SetEffect to specific sounds or sound categories. Essentially, this feature is built upon using SetEffect. Last updated 9 months ago * [Introduction](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/dominator-player#introduction) * [How To Use?](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/dominator-player#how-to-use) * [.AsDominator()](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/dominator-player#asdominator) * [Side Note:](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/dominator-player#side-note) sun-brightdesktopmoon sun-brightdesktopmoon --- # Spatial & Mix | BroAudio ![Page cover](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1617994452722-4145e196248b%3Fcrop%3Dentropy%26cs%3Dsrgb%26fm%3Djpg%26ixid%3DM3wxOTcwMjR8MHwxfHNlYXJjaHwxfHxzb3VuZHxlbnwwfHx8fDE3NDE5MzA4ODd8MA%26ixlib%3Drb-4.0.3%26q%3D85&width=1248&dpr=3&quality=100&sign=54923c2c&sv=2) [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/spatial-and-mix#introduction) Introduction ------------------------------------------------------------------------------------------------------------------------------------------------------------ If you've used Unity's [AudioSourcearrow-up-right](https://docs.unity3d.com/Manual/class-AudioSource.html) , you might have noticed a section called **3D Sound Settings** at the bottom. This is used to simulate how sound behaves in a real-world space. In other words, it adjusts volume and panning based on the position and distance between the listener and the sound source in the scene. So don’t let the term _3D_ mislead you🤣 this feature is just as useful in a 2D game! A more common name for it is actually **Spatial Audio**. ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252F6eMBC977xMS6F1FmPPdh%252FSpatialSetting.png%3Falt%3Dmedia%26token%3Dd952b847-3809-42a9-a718-fd4e554bf7d4&width=768&dpr=3&quality=100&sign=14baa4da&sv=2) [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/spatial-and-mix#basic-understanding) Basic Understanding -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Bro Audio’s Spatial & Mix feature combines **3D Sound Settings, Spatial Blend, Stereo Pan, and Reverb Zone Mix** into a single asset. These functionalities work exactly the same as in Unity’s AudioSource, so there’s nothing new to learn. However, if you haven’t used these features in Unity before, there’s one key value you should understand first. #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/spatial-and-mix#spatial-blend) **Spatial Blend** This value determines how much the sound is affected by 3D Sound Settings, meaning how its volume and panning change based on the listener’s distance and position relative to the sound source. * **0 (2D):** The sound ignores distance and position, playing directly through your audio system (speakers, headphones, etc.). * **1 (3D):** The sound fully respects distance and position, making it behave naturally in the space. So, if you want a sound to play at a specific location, simply set Spatial Blend to 1 (or any value greater than 0, depending on your needs). For more details on other settings, please refer to [Unity’s documentationarrow-up-right](https://docs.unity3d.com/Manual/AudioSource-reference.html) . [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/spatial-and-mix#how-to-use) How To Use? --------------------------------------------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/spatial-and-mix#play-the-sound-in-the-scene-with-default-settings) **Play the sound in the scene with default settings** If you just want the sound to play in the scene without tweaking anything, you can: * Use the [**SoundSource**](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/sound-source) component and set [**Position Mode**](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/sound-source#position-mode) to **StayHere** or **FollowTarget**. * Use [`BroAudio.Play(SoundID, Vector3)`](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#playback) or [`BroAudio.Play(SoundID, Transform)`](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#playback) . With these approaches, Bro Audio will **automatically set Spatial Blend to 1 (3D)** when playing the sound and leave all other settings at their defaults. circle-info Curious about what the default settings are? Just add Unity’s **AudioSource** component to a GameObject, inspect its values, or play a sound to check them! ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/spatial-and-mix#play-the-sound-with-customized-spatial-and-mix-settings) **Play the sound with customized spatial & mix settings** If you need more control over how the sound behaves in space, follow these steps: 1. Open the **Library Manager,** select an entity, and switch to the **Overall** tab. 2. Click **\[Create and Open\]** next to the **Spatial & Mix** field. Didn't see the option? 3. After Saving the spatial settings file. The **Spatial Settings** window will open immediately. 4. Adjust the properties just like you would in Unity’s `AudioSource`. Once the sound has custom spatial settings, they’ll be applied automatically when played in the scene using the same approaches as mentioned above: > 1. Use the SoundSource component and set the Position Mode to StayHere or FollowTarget. > > 2. Use `BroAudio.Play(SoundID, Vector3)`, or `BroAudio.Play(SoundID, Trandform)` method. > circle-info If you want the sound to play **globally**, ignoring spatial settings, you can also: * Use **Global** Position Mode in the **SoundSource** component. * Use `BroAudio.Play(SoundID)`. circle-check The spatial setting is just a Scriptable Object, it can be shared around multiple sounds! Last updated 3 months ago * [Introduction](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/spatial-and-mix#introduction) * [Basic Understanding](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/spatial-and-mix#basic-understanding) * [How To Use?](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/spatial-and-mix#how-to-use) * [Play the sound in the scene with default settings](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/spatial-and-mix#play-the-sound-in-the-scene-with-default-settings) * [Play the sound with customized spatial & mix settings](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/spatial-and-mix#play-the-sound-with-customized-spatial-and-mix-settings) sun-brightdesktopmoon sun-brightdesktopmoon --- # Chained Playback | BroAudio [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/chained-playback#introduction) Introduction ------------------------------------------------------------------------------------------------------------------------------------------------------------- Chained Playback lets you build a sound sequence that plays in stages: a **Start** sound, a looping **Loop** sound, and a final **End** sound. This is ideal for gameplay situations where an action has a beginning, an ongoing state, and an ending, such as casting a spell, charging a weapon, or running an engine. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/chained-playback#how-to-use) How To Use? ---------------------------------------------------------------------------------------------------------------------------------------------------------- If an AudioEntity contains more than one clip, the [PlayMode](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#playmode) option will appear at the top of the clip list. Set it to **Chained**, and you'll see the Playback stage: Start, Loop, and End displayed on the right side. ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252F4kWmAfWYHSddrKhwitRi%252FChainedPlayMode.png%3Falt%3Dmedia%26token%3De7e4ade5-e2d2-414f-b188-a1d457764603&width=768&dpr=3&quality=100&sign=efb7cfc7&sv=2) ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/chained-playback#start) **Start** The first sound to play when this entity is triggered to play. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/chained-playback#loop) **Loop** Plays immediately after the **Start** sound and loops continuously until it's triggered to stop. When using Chained mode, BroAudio will automatically handle the loop playback at runtime, even if no loop options are set in the **Overall** tab. In that case, the system will use the default loop settings defined in _**Tools > BroAudio > Preferences**_. If no loop options are set in the **Overall** tab, a warning message will appear above the clip list, letting you know that default settings will be used. You can: * Click **\[Apply Default\]** to explicitly apply those settings to the entity. * Hide this message in _**Tools > BroAudio > Preferences**_ **- Chained Play Mode: Show Warning If No Loop**. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/chained-playback#end) **End** The final sound played when it's triggered to stop. This is actually optional. If not assigned, the **Start** and **Loop** sounds will still work as expected, and playback will simply stop when `Stop()` is called. circle-check The 3 clips don’t necessarily have to be different! You can use the same clip for all three stages by using different parts of it. Last updated 6 months ago * [Introduction](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/chained-playback#introduction) * [How To Use?](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/chained-playback#how-to-use) * [Start](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/chained-playback#start) * [Loop](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/chained-playback#loop) * [End](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/chained-playback#end) sun-brightdesktopmoon sun-brightdesktopmoon --- # Music Player | BroAudio ![Page cover](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1526394931762-90052e97b376%3Fcrop%3Dentropy%26cs%3Dsrgb%26fm%3Djpg%26ixid%3DM3wxOTcwMjR8MHwxfHNlYXJjaHwyfHxtdXNpYyUyMHBsYXllcnxlbnwwfHx8fDE3MTI4ODk0NDF8MA%26ixlib%3Drb-4.0.3%26q%3D85&width=1248&dpr=3&quality=100&sign=679a22fb&sv=2) [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/music-player#introduction) Introduction ------------------------------------------------------------------------------------------------------------------------------------- MusicPlayer allows you to seamlessly switch between different BGMs effortlessly. Whenever players enter a new scene or trigger a specific plot point, you can instantly play new music using a new [SoundID](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager#entity) without needing to know which one was playing before. The key differences between MusicPlayer and standard players are: 1. Only one Entity(SoundID) is played at a time (except during transitions). 2. It automatically transitions from the previous one to the new one, and the previous one will stop after the transition is complete. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/music-player#how-to-use) How To Use? ---------------------------------------------------------------------------------------------------------------------------------- For the no-code approach, there is an option in _**Tools > BroAudio > Preferences**_ named "Always Play Music As BGM". if it's enabled, all entities with audio type: [Music](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/broaudiotype) will apply this feature with the transition setting specified under this option. However, the recommended way is to implement this feature via code for better flexibility and maintainability. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/music-player#asbgm) .AsBGM() Play the music using the basic API, and add .AsBGM() after it, the sound will be played as MusicPlayer. Copy BroAudio.Play(_id).AsBGM(); 🔔The sound doesn't have to be a [BroAudioType.Music](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/broaudiotype) , there is no restriction on this API. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/music-player#settransition-transition-transition-float-fadetime) .SetTransition([Transition](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/transition) transition, float fadeTime) You can specify the transition type and the duration of the transition. If you don't set the fadeTime, the system will use the FadeIn and FadeOut settings of the entity that is defined in [LibraryManager](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager) ; otherwise, these settings will be ignored (or overridden). The types of transitions include: * Default: FadeOut the current one, and then FadeIn the new one. * Immediate: Immediately stop the current one and play the new one without any transition. * OnlyFadeIn: Immediately stop the current one, then FadeIn the new one. * OnlyFadeOut: FadeOut the current one, then immediately play the new one. * CrossFade: Start playing the next one with FadeIn while the previous one begins to FadeOut. The settings for fadeTime, Transition, and settings of the Entity interact with each other. The rule is: Unless using [Transition](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/transition) [.Immediat](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/transition) e (ignoring all fadeTime), the argument: **fadeTime** has the highest priority. If it's not set, the system defaults to the entity's FadeIn/Out settings, followed by the transition mode. _The configurations in the following table all result in the equivalent of_ [_Transition.Immediate_](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/transition) _, meaning there is no transition involved. Hope this can help you understand the relationships._ Entity FadeIn Entity FadeOut Transition FadeTime 0 0 Default Not set 2 2 CrossFade 0 2 2 Immediate 2 0 2 OnlyFadeIn Not Set 2 0 OnlyFadeOut NotSet Last updated 9 months ago * [Introduction](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/music-player#introduction) * [How To Use?](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/music-player#how-to-use) * [.AsBGM()](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/music-player#asbgm) * [.SetTransition(Transition transition, float fadeTime)](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/music-player#settransition-transition-transition-float-fadetime) sun-brightdesktopmoon sun-brightdesktopmoon --- # Playback Group | BroAudio ![Page cover](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1476231682828-37e571bc172f%3Fcrop%3Dentropy%26cs%3Dsrgb%26fm%3Djpg%26ixid%3DM3wxOTcwMjR8MHwxfHNlYXJjaHwyfHxmb3Jlc3R8ZW58MHx8fHwxNzM4NDY1ODQ3fDA%26ixlib%3Drb-4.0.3%26q%3D85&width=1248&dpr=3&quality=100&sign=52ce5664&sv=2) [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#introduction) Introduction -------------------------------------------------------------------------------------------------------------------------- Playback Group is a set of rules that can be used to manage the playback behavior of multiple sounds as a group. It determines whether a sound can be played and can also stop playback when certain conditions are met. * * * [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#how-to-use) How To Use? ----------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#creating-a-playback-group) Creating a Playback Group Playback Groups are ScriptableObjects that can be created by right-clicking in the Project Winodw, and selecting _Create > BroAudio > PlaybackGroup_. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#assigning-a-playback-group) Assigning a Playback Group Once created, a playback group can be assigned to [AudioAsset](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager#asset) , [AudioEntity](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager#entity) , or even passed directly when calling [`BroAudio.Play()`](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#playback) , which overrides any pre-existed groups assigned to the sound. ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252FFHWTDLOlqVmXoIzOUkTE%252FPlaybackGroupField.png%3Falt%3Dmedia%26token%3Decd74c3c-2b8a-44bd-9dbd-a7a322bc04e4&width=768&dpr=3&quality=100&sign=b9595b58&sv=2) [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#the-hierarchical-design) The Hierarchical Design ------------------------------------------------------------------------------------------------------------------------------------------------ Playback Groups follow a hierarchy that aligns with **AudioAssets** and **AudioEntities**, plus a system-level group (Global Playback Group) above them and an optional override when calling [`BroAudio.Play()`](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#playback) . The hierarchy is as follows: ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252FHMRlczZYHvMpAiVAZydU%252FPlaybackGroup%2520hierarchical%2520design.png%3Falt%3Dmedia%26token%3Da9d078ef-f25d-4a73-9a5b-6a54aabaccbf&width=768&dpr=3&quality=100&sign=d62e698a&sv=2) This means that if no group is assigned at a specific level, the system will look for an avaliable group from its upper level until it reaches to the top level, which is the **Global Playback Group**. This top group is never null and typically have the least restrictive rules. circle-check The **Globabl Playback Group** can be customized in _Tools > BroAudio > Preferences._ Not only does this hierarchy apply to groups, but it also applies to individual **rules** within a group. Each rule can choose to override or inherit its behavior from an upper-level group. (More details in the _Override_ section.) * * * [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#what-it-does) What it does? --------------------------------------------------------------------------------------------------------------------------- A Playback Group contains **a set of rules that are evaluated whenever a sound is cued for playback**. If all rules pass, the sound plays; otherwise, playback is canceled. When selecting the asset file of a Playback Group, the Inspector displays a table with three columns. Let’s take the built-in **GlobalPlaybackGroup.asset** as an example to explain these columns: ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252F6QArhBqICw0ecndMcwfj%252FplaybackGroupInspector.png%3Falt%3Dmedia%26token%3Df3054f38-77cd-4c1c-bdca-0d1b855f4acc&width=768&dpr=3&quality=100&sign=f5257291&sv=2) ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#override) Override The first column, marked with a ✏️ icon, represents the Override option. * When **enabled**, the rule is applied within this group. * When **disabled**, the rule is ignored, and the system searches for an applicable rule in the upper levels of the hierarchy. Since **GlobalPlaybackGroup.asset** is at the system level (assigned in _Tools > BroAudio > Preferences_), all override options are typically enabled here circle-info If no enabled rule is found at any level, the system simply allows playback. This can happen if: 1. No groups have the override option enabled for a particular rule. 2. The rule does not exist in any upper-level groups (which can happen with [Custom Rules](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#custom-rules) ). ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#rule-and-value) Rule and Value **Max Playable Count** This rule tracks the number of playing sounds managed by the group. If it reaches the specified limit (the value), any additional play requests will be canceled. This is useful for controlling large numbers of sounds in a scene and maintaining balance between different sound types. The default value is **Infinity**, meaning there's no limit. **Comb Filtering Time** This rule prevents sounds playing in a short period of time from producing the [Comb-Filtering effect](https://man572142s-organization.gitbook.io/broaudio/reference/audio-terminology#comb-filtering) . The default value is **0.04 seconds**, but you can adjust it as needed or set it to **0** to disable this prevention. circle-check Rules can have more properties to assist it when evaluating, these are called the "**Derivative properties**". For example, Comb-Filtering Time has: _**Ignore If Same Frame**_ Bypasses the rule if identical sounds are played within the exact same frame. _**Ignore If Distance Is Greater Than**_ Bypasses the rule if identical sounds are played farther apart than the specified distance. If one of the sounds is played globally, it’s treated as an infinite distance (may change to use the AudioListener's position in the future). If both are played globally, it’s treated as zero distance. _**Log Warning If Occurs**_ Logs a warning if identical sounds are played within the prevention time. * * * [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#custom-rules) Custom Rules -------------------------------------------------------------------------------------------------------------------------- The built-in GlobalPlaybackGroup and any groups created via _Create > BroAudio > PlaybackGroup_ are made by the **DefaultPlaybackGroup** script, which include rules like Max Playable Count and Comb-Filtering Time by default. However, you can also create a new one from scratch or inherit the **DefaultPlaybackGroup** to extend its functionality! ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#creating-custom-rules-and-playback-groups) Creating Custom Rules and Playback Groups To add custom rules, create a new class that inherit from either: * `DefaultPlaybackGroup` to retain BroAudio’s pre-configured rules * `PlaybackGroup` to create a new group from scratch This allows you to define new rules by declaring values and overriding methods. * * * [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#the-api) The API ---------------------------------------------------------------------------------------------------------------- ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#rule-less-than-t-greater-than) _Rule_ A generic abstract class representing a rule in a Playback Group. It stores a value and a method that used for evaluating playbacks. **Creation** Define a class that inherits from `Rule`: **Declaration** Declare the Rule in the PlaybackGroup ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#playbackgroup) _PlaybackGroup_ An abstract class that defines the rules. It inherits from ScriptableObject and implements [IPlayableValidator](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#iplayablevalidator) . #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#defining-rules-in-a-playback-group) Defining Rules in a Playback Group `InitializeRules()` A method that should be overridden to initialize all the rules. Please use the **Initialize(IRule, IsPlayableDelegate)** method in conjunction to setup the rules. `Initialize(IRule, IsPlayableDelegate)` Assigns a method to a rule for evaluating playback. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#iplayablevalidator) _IPlayableValidator_ `IsPlayable(SoundID, Vector3 position)` Whether the sound can be played or not. When played globally, the position defaults to [Vector3.negativeInfinityarrow-up-right](https://docs.unity3d.com/6000.2/Documentation/ScriptReference/Vector3-negativeInfinity.html) . circle-info This method is also encapsulated as `IsPlayableDelegate`, which is used in `Rule`. `OnGetPlayer(IAudioPlayer player)` Triggered when the player passes the rule and is about to play. You can cache the player for further control. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#attributes) Attributes There are attributes available for Rule and PlaybackGroup. Attribute Description [\[SerializeField\]arrow-up-right](https://docs.unity3d.com/6000.0/Documentation/ScriptReference/SerializeField.html) Saves the value in the asset and exposes it in the Inspector. [\[Tooltip\]arrow-up-right](https://docs.unity3d.com/6000.0/Documentation/ScriptReference/TooltipAttribute.html) Displays a tooltip when hovering over a rule. \[InspectorName\] Changes the display name of a rule in the inspector. \[ValueButton\] Adds a button for modifying the rule’s value. \[DerivativeProperty\] ForDraws a connection line in the Inspector to show rule relationships. Use `isEnd` to specify the endpoint. \[CustomDrawing\ \ Method\] Uses a custom method for drawing the rule in the Inspector. parameters: Type className, string methodName [\[Header\]arrow-up-right](https://docs.unity3d.com/6000.0/Documentation/ScriptReference/HeaderAttribute.html) Adds a header above some fields in the Inspector. [\[Space\]arrow-up-right](https://docs.unity3d.com/6000.0/Documentation/ScriptReference/SpaceAttribute.html) Adds spacing in the Inspector. Last updated 3 months ago * [Introduction](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#introduction) * [How To Use?](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#how-to-use) * [Creating a Playback Group](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#creating-a-playback-group) * [Assigning a Playback Group](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#assigning-a-playback-group) * [The Hierarchical Design](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#the-hierarchical-design) * [What it does?](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#what-it-does) * [Override](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#override) * [Rule and Value](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#rule-and-value) * [Custom Rules](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#custom-rules) * [Creating Custom Rules and Playback Groups](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#creating-custom-rules-and-playback-groups) * [The API](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#the-api) * [Rule](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#rule-less-than-t-greater-than) * [PlaybackGroup](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#playbackgroup) * [IPlayableValidator](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#iplayablevalidator) * [Attributes](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#attributes) sun-brightdesktopmoon Copy // Example from DefaultPlaybackGroup [Serializable] public class MaxPlayableCountRule : Rule { public MaxPlayableCountRule(int value) : base(value) { } // Optional: Allow implicit conversion from int public static implicit operator MaxPlayableCountRule(int value) => new MaxPlayableCountRule(value); } Copy // Example from DefaultPlaybackGroup [SerializedField] private MaxPlayableCountRule _maxPlayableCount = new Rule(-1); // or _maxPlayableCount = -1; if the implicit operator is implemented Copy // Example from DefaultPlaybackGroup protected override IEnumerable InitializeRules() { yield return Initialize(_maxPlayableCount, IsPlayableLimitNotReached); yield return Initialize(_combFilteringTime, CheckCombFiltering); } sun-brightdesktopmoon --- # Useful Attrubutes | BroAudio ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/tools/useful-attrubutes#volume) \[Volume\] Mark a float field to be shown as a [BroAuido volume slider](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/volume-control#editor-slider) ranging from 0 to 10 (-80dB to +20dB). circle-exclamation The volume range in WebGL is from 0 to 1, and the slider will be linear. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/tools/useful-attrubutes#volume-bool-canboost) \[Volume(bool canBoost)\] If canBoost is true, the float field will be shown as a [BroAuido volume slider](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/volume-control#editor-slider) with a range from 0 to 10. otherwise, it will be shown as a regular linear slider. circle-exclamation canBoost = true in WebGL is not supported. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/tools/useful-attrubutes#frequency) \[Frequency\] Mark a float field to be shown as a Logarithmic slider ranging from 10Hz to 22000Hz. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/tools/useful-attrubutes#pitch) \[Pitch\] Mark a float field to be shown as a linear slider ranging from -3 to 3 Last updated 1 year ago * [\[Volume\]](https://man572142s-organization.gitbook.io/broaudio/tools/useful-attrubutes#volume) * [\[Volume(bool canBoost)\]](https://man572142s-organization.gitbook.io/broaudio/tools/useful-attrubutes#volume-bool-canboost) * [\[Frequency\]](https://man572142s-organization.gitbook.io/broaudio/tools/useful-attrubutes#frequency) * [\[Pitch\]](https://man572142s-organization.gitbook.io/broaudio/tools/useful-attrubutes#pitch) sun-brightdesktopmoon sun-brightdesktopmoon --- # Addressables | BroAudio ![Page cover](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1476973422084-e0fa66ff9456%3Fcrop%3Dentropy%26cs%3Dsrgb%26fm%3Djpg%26ixid%3DM3wxOTcwMjR8MHwxfHNlYXJjaHw2fHxtYXB8ZW58MHx8fHwxNzM4NDY1NDg2fDA%26ixlib%3Drb-4.0.3%26q%3D85&width=1248&dpr=3&quality=100&sign=eabd7f6e&sv=2) [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/addressables#introduction) Introduction ------------------------------------------------------------------------------------------------------------------------ [Addressablesarrow-up-right](https://docs.unity3d.com/Manual/com.unity.addressables.html) is a dynamic asset management solution provided by Unity. It helps determine which audio clips should be loaded, when thet are needed, and how they are loaded. circle-exclamation This documentation covers use Addessables **in BroAudio**. For further details and the official Addressables manual, please refer to the [Unity Manualarrow-up-right](https://docs.unity3d.com/Packages/com.unity.addressables@2.3/manual/index.html) . [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/addressables#how-to-use) How To Use? --------------------------------------------------------------------------------------------------------------------- To install Addressables package, please follow the instructions in [Unity's manualarrow-up-right](https://docs.unity3d.com/Packages/com.unity.addressables@2.3/manual/installation-guide.html) . Once the package is installed, BroAudio will automatically unlock all addressables related options. No futher configurations needed! ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252Fpc16PcwivQqgqPaG5rAu%252FAddressables.png%3Falt%3Dmedia%26token%3D43d040fd-b46a-4906-8598-dce63c065eae&width=768&dpr=3&quality=100&sign=e48ae3e4&sv=2) ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/addressables#marking-entities-and-audio-clips-as-addressables) Marking Entities and Audio Clips as Addressables Addressables requires two things to work: 1. An asset marked as Addressables. 2. An [AssetReferencearrow-up-right](https://docs.unity3d.com/Packages/com.unity.addressables@1.20/manual/AssetReferences.html) for addressing the asset. The first step is pretty straightforward. Just find all the audio clips you plan to use with Addressables and mark them as Addressable in the inspector. The second step is also simple. Open the LibraryManager, select an entity, and you will see an Addressables checkbox in the upper-right area of the Clips tab. Just check it! These two steps can actually be done at the same time. You can first add audio clips to an entity and then mark the entity as Addressable. **If the entity already contains clips, a** **Reference Conversion Confirmation** **window will appear**, asking how you want to handle them. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/addressables#reference-conversion) Reference Conversion One major benefit of using Addressables is that it utilizes indirect references (usually with `AssetReference`). This means the asset is not loaded immediately when referenced, unlike direct references, helping reduce memory usage at runtime. The confirmation window provides three options: **\[Yes\]** Converts the current clip list to `AssetReference` and automatically marks the corresponding audio clip assets as Addressable, so you don't have to mark them manually. **\[Yes, don't ask again\]** Same as \[Yes\], but remembers your choice so the window won’t appear again.. **\[No\] or close the window** No changes are made, and the Addressables checkbox remains as is. The same confirmation window will also popup when the list is already using `AssetReference`, but in the opposite way. Clicking \[**Yes\]** will convert the clip list to direct references and unmark all corresponding audio clip assets as Addressable. #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/addressables#other-conversion-settings) Other Conversion Settings You can configure additional options for reference conversion under _Tools/BroAudio/Preferences - Miscellaneous._ ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252FAcpfLm66rbqidkObt2Wl%252FUnity_wN62FE7bp1.png%3Falt%3Dmedia%26token%3D61c2720e-07e2-473b-9201-e2899ee66aa1&width=768&dpr=3&quality=100&sign=2f81a182&sv=2) **Always Ask** Always show the confirmation window. **Only Convert** Convert the list to the target reference type without changing the Addressables state of the clip assets. **Convert And Set Addressables** Convert the list and mark/unmark Addressables on the clip assets. This is the default behavior for \[Yes\] and \[Yes, don't ask again\]. Plus, \[don't ask again\] will change the setting to this option while \[Yes\] remains on Always Ask. **Convert And Clear All References** Convert the list and remove all references from it. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/addressables#loading-the-asset) Loading the asset ---------------------------------------------------------------------------------------------------------------------------------- Now that the audio clips are set as Addressables, managing their loading process is up to us. The API functions similarly to Unity’s standard Addressables APIs. You call the loading method, get an [AsyncOperationHandlearrow-up-right](https://docs.unity3d.com/Packages/com.unity.addressables@1.22/manual/AddressableAssetsAsyncOperationHandle.html) , wait for it to complete before using the asset, and release it when it's no longer needed. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/addressables#public-methods-in-broaudio-class) Public Methods in [BroAudio](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio) class Method Return Parameters Description **LoadAllAssetsAsync** [AsyncOperationHandlearrow-up-right](https://docs.unity3d.com/Packages/com.unity.addressables@1.22/manual/AddressableAssetsAsyncOperationHandle.html) > [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id Loads all the audio clips in the entity **LoadAssetAsync** [AsyncOperationHandlearrow-up-right](https://docs.unity3d.com/Packages/com.unity.addressables@1.22/manual/AddressableAssetsAsyncOperationHandle.html) [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id Loads the first audio clips in the entity [AsyncOperationHandlearrow-up-right](https://docs.unity3d.com/Packages/com.unity.addressables@1.22/manual/AddressableAssetsAsyncOperationHandle.html) [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id, int index Loads the audio clip in the entity's clip list by index **ReleaseAllAssets** void [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id Releases all the audio clips in the entity **ReleaseAsset** void [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id Releases the first audio clips in the entity void [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id, int index Releases the audio clip in the entity's clip list by index Last updated 12 months ago * [Introduction](https://man572142s-organization.gitbook.io/broaudio/core-features/addressables#introduction) * [How To Use?](https://man572142s-organization.gitbook.io/broaudio/core-features/addressables#how-to-use) * [Marking Entities and Audio Clips as Addressables](https://man572142s-organization.gitbook.io/broaudio/core-features/addressables#marking-entities-and-audio-clips-as-addressables) * [Reference Conversion](https://man572142s-organization.gitbook.io/broaudio/core-features/addressables#reference-conversion) * [Loading the asset](https://man572142s-organization.gitbook.io/broaudio/core-features/addressables#loading-the-asset) * [Public Methods in BroAudio class](https://man572142s-organization.gitbook.io/broaudio/core-features/addressables#public-methods-in-broaudio-class) sun-brightdesktopmoon sun-brightdesktopmoon --- # Audio Effect | BroAudio ![Page cover](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1608311821539-57a58f13b074%3Fcrop%3Dentropy%26cs%3Dsrgb%26fm%3Djpg%26ixid%3DM3wxOTcwMjR8MHwxfHNlYXJjaHw0fHxlZmZlY3R8ZW58MHx8fHwxNzEzNzcwMzY2fDA%26ixlib%3Drb-4.0.3%26q%3D85&width=1248&dpr=3&quality=100&sign=f57c3c7d&sv=2) [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-effect#introduction) Introduction ------------------------------------------------------------------------------------------------------------------------ Audio effects can enhance the immersion and fun of your game. BroAudio supports all of Unity's built-in audio effects and allows for dynamic parameter adjustments during gameplay. There are two ways to apply audio effects: * `BroAudio.SetEffect(BroAudioType)` * `IAudioPlayer.AddXXXEffect()` [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-effect#set-effects-for-a-specific-type) Set effects for a specific type -------------------------------------------------------------------------------------------------------------------------------------------------------------- This applies an [audio **mixer** effectarrow-up-right](https://docs.unity3d.com/6000.2/Documentation/Manual/class-AudioEffectMixer.html) to all audio of a specified [BroAudioType](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/broaudiotype) . It's ideal when you want to apply a single effect to an entire category of sounds, such as changing the sound of all ambient tracks or sound effects simultaneously. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-effect#how-to-use) How To Use #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-effect#create-an-effect-data-struct) Create an '[Effect](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/effect) ' data struct To trigger an audio effect at runtime, you need to create an [Effect](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/effect) struct with the parameter values via the static factory methods. This data will be passed as a parameter to the `SetEffect` method. Copy // 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. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-effect#broaudio.seteffect-effect-broaudiotype) `BroAudio.SetEffect(Effect, BroAudioType)` Common use cases and API examples: #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-effect#when-the-player-is-underwater) When the player is underwater #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-effect#add-more-effect) 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. Therefore, it's highly recommended to use the [Audio Effect Editor](https://man572142s-organization.gitbook.io/broaudio/tools/audio-effect-editor) to add more effect. It lets you focus on the **Effect** track and only displays the [Exposed Parametersarrow-up-right](https://docs.unity3d.com/6000.2/Documentation/Manual/AudioMixerInspectors.html) of the Audio Effects. [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-effect#add-effects-to-individual-audio-players) Add Effects to Individual Audio Players ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ This applies [audio **filter** effectsarrow-up-right](https://docs.unity3d.com/6000.2/Documentation/Manual/class-AudioEffect.html) to a specific audio instance, offering more granular control. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-effect#how-to-use-1) How To Use Use the chaining methods on the [`IAudioPlayer`](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer) instance returned by [`BroAudio.Play()`](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#public-methods) methods. For example: ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-effect#available-effects) Available Effects You can chain any of the following effect methods to an [IAudioPlayer](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer) : * [AddChorusEffect()arrow-up-right](https://docs.unity3d.com/6000.2/Documentation/Manual/class-AudioChorusFilter.html) * [AddDistortionEffect()arrow-up-right](https://docs.unity3d.com/6000.2/Documentation/Manual/class-AudioDistortionFilter.html) * [AddEchoEffect()arrow-up-right](https://docs.unity3d.com/6000.2/Documentation/Manual/class-AudioEchoFilter.html) * [AddHighPassEffect()arrow-up-right](https://docs.unity3d.com/6000.2/Documentation/Manual/class-AudioHighPassFilter.html) * [AddLowPassEffect()arrow-up-right](https://docs.unity3d.com/6000.2/Documentation/Manual/class-AudioLowPassFilter.html) * [AddReverbEffect()arrow-up-right](https://docs.unity3d.com/6000.2/Documentation/Manual/class-AudioReverbFilter.html) Each of these methods accepts an `onSet` action to configure the effect's parameters. #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-effect#removing-effects) Removing Effects You can also remove effects from an audio player using the corresponding `Remove...Effect()` methods: Last updated 4 months ago * [Introduction](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-effect#introduction) * [Set effects for a specific type](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-effect#set-effects-for-a-specific-type) * [How To Use](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-effect#how-to-use) * [BroAudio.SetEffect(Effect, BroAudioType)](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-effect#broaudio.seteffect-effect-broaudiotype) * [Add Effects to Individual Audio Players](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-effect#add-effects-to-individual-audio-players) * [How To Use](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-effect#how-to-use-1) * [Available Effects](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-effect#available-effects) sun-brightdesktopmoon Copy 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. Copy // Play a sound and apply a low-pass filter to it. BroAudio.Play(sound) .AddLowPassEffect(lowpass => lowpass.cutoffFrequency = 1000f); // You can also add multiple effects // If the onSet parameter doesn't fulfill, the effect use the Unity's default value BroAudio.Play(anotherSound) .AddLowPassEffect() .AddReverbEffect(reverb => reverb.reverbPreset = AudioReverbPreset.Room); Copy var myPlayer = BroAudio.Play("mySound") .AddLowPassEffect(); // ... later on myPlayer.RemoveLowPassEffect(); sun-brightdesktopmoon --- # Audio Effect Editor | BroAudio ![Page cover](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252FlSjhsQ8ItQt9Y0t6BGur%252FUnity_XALPU2Zx5e.png%3Falt%3Dmedia%26token%3D3400d0bc-7b76-4b20-963d-d442f3a193bc&width=1248&dpr=3&quality=100&sign=49b79373&sv=2) [hashtag](https://man572142s-organization.gitbook.io/broaudio/tools/audio-effect-editor#introduction) Introduction ----------------------------------------------------------------------------------------------------------------------- Audio Effect Editor is a tool derived from the [BroAudioMixer](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer) that only shows the Effect tracks and its Exposed Parameters. This can keep the main section of the mixer untouched and help you focus on the audio effects only. [hashtag](https://man572142s-organization.gitbook.io/broaudio/tools/audio-effect-editor#how-to-use) How To Use? -------------------------------------------------------------------------------------------------------------------- It's actually the same as the [Audio Mixerarrow-up-right](https://docs.unity3d.com/Manual/AudioMixer.html) window, just edited in the way you're familiar with. If you're not quite familiar with using the [Audio Mixerarrow-up-right](https://docs.unity3d.com/Manual/AudioMixer.html) yet, you can check out the official tutorial below: [Audio Effects - Unity Official Tutorialsarrow-up-right](https://youtu.be/jH5mKdwI65o?si=dmGBt-kxDvKxJ1Vr) [AudioMixer Exposed Parameters - Unity Official Tutorialsarrow-up-right](https://youtu.be/9tqi1aXlcpE?si=_Ub8mNlonYbbvxEu) Last updated 1 year ago * [Introduction](https://man572142s-organization.gitbook.io/broaudio/tools/audio-effect-editor#introduction) * [How To Use?](https://man572142s-organization.gitbook.io/broaudio/tools/audio-effect-editor#how-to-use) sun-brightdesktopmoon sun-brightdesktopmoon --- # Audio Clip Editor | BroAudio ![Page cover](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252FGLhydeTKmox1r7lQF26v%252FUnity_9xp94jo4iL.png%3Falt%3Dmedia%26token%3D2f34f308-08b6-4bec-a613-06e69404b9c3&width=1248&dpr=3&quality=100&sign=8669c34f&sv=2) [hashtag](https://man572142s-organization.gitbook.io/broaudio/tools/clip-editor#introduction) Introduction --------------------------------------------------------------------------------------------------------------- This could help you edit the audio file permanently in Unity. So you don't need to use other tools to edit the original file. Also, this can help you decrease the file size by trimming unwanted segments or converting it to mono. [hashtag](https://man572142s-organization.gitbook.io/broaudio/tools/clip-editor#how-to-use) How To Use? ------------------------------------------------------------------------------------------------------------ Select an audio clip to start editing. Click Save to export the edited clip and replace the original file. Click Save As to export the edited clip as a new file. [hashtag](https://man572142s-organization.gitbook.io/broaudio/tools/clip-editor#parameters) Parameters ----------------------------------------------------------------------------------------------------------- ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/tools/clip-editor#playback-position-in-seconds) Playback Position (in seconds) circle-check The playback position can be controlled by dragging the icon on the waveform GUI **Start:** The clip's beginning; segments before this will be trimmed. **End:** Marks the clip's ending; segments after this will be trimmed. **In:** The duration time of the fade-in process that will be applied. **Out:** The duration time of the fade-out process that will be applied. **Delay:** The duration time before the clip's beginning, silence segments will be added. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/tools/clip-editor#volume) Volume Select the tab to change the volume when exporting the clip. circle-exclamation Increasing the volume too much may cause clipping (distortion). Gradually increase the volume, saving frequently to listen and observe the waveform changes as you go. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/tools/clip-editor#reverse) Reverse Reversing the entire clip, so it plays backward, can create a cool effect. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/tools/clip-editor#convert-to-mono) Convert To Mono Converting a stereo sound to mono can decrease the file size a lot! It can help you save some memory at runtime, and decrease the size of your final build. There are two methods available here 1. **Downmixing:** Mix the two channels together. 2. **Left/ Right:** Choose one of the channels, and abandon the other one. Last updated 1 year ago * [Introduction](https://man572142s-organization.gitbook.io/broaudio/tools/clip-editor#introduction) * [How To Use?](https://man572142s-organization.gitbook.io/broaudio/tools/clip-editor#how-to-use) * [Parameters](https://man572142s-organization.gitbook.io/broaudio/tools/clip-editor#parameters) * [Playback Position (in seconds)](https://man572142s-organization.gitbook.io/broaudio/tools/clip-editor#playback-position-in-seconds) * [Volume](https://man572142s-organization.gitbook.io/broaudio/tools/clip-editor#volume) * [Reverse](https://man572142s-organization.gitbook.io/broaudio/tools/clip-editor#reverse) * [Convert To Mono](https://man572142s-organization.gitbook.io/broaudio/tools/clip-editor#convert-to-mono) sun-brightdesktopmoon sun-brightdesktopmoon --- # Customization | BroAudio ![Page cover](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1604079628040-94301bb21b91%3Fcrop%3Dentropy%26cs%3Dsrgb%26fm%3Djpg%26ixid%3DM3wxOTcwMjR8MHwxfHNlYXJjaHw5fHxjb2xvcnxlbnwwfHx8fDE3MTM3NzA1NzF8MA%26ixlib%3Drb-4.0.3%26q%3D85&width=1248&dpr=3&quality=100&sign=2bd86ccb&sv=2) In this section, we will discuss the preference settings in BroAudio. Locate to _**Tools > BroAudio > Preferences**_ and open the editor window. You will see a tab view just like the one below. 🎵Audio 🎨GUI 🔘Misc **Global Playback Group** For assigning a [playback group](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group) at the system level to act as the base fallback for all groups/rules. **Audio Filter Slope** Determines the default value of the attenuation per octave that the HighPass/LowPass applies to. The higher the value it set, the more frequencies are attenuated by the filter. more info will be explained in [Technical Details-Audio Filter Design](https://man572142s-organization.gitbook.io/broaudio/reference/technical-details#the-audio-filter-design-in-broaudio) **Update Mode** Determines whether audio processing, including volume changes, effects, and playback logic, is affected by [Time.timeScalearrow-up-right](https://docs.unity3d.com/6000.1/Documentation/ScriptReference/Time-timeScale.html) . ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/customization#bgm) BGM **Always Play Music As BGM** If enabled, every entity with BroAudioType.Music will be played by the [MusicPlayer](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/music-player) . **Default Transition** If "Always Play Music As BGM" is enabled, this option will appear, allowing you to set the transition type that the entity with BroAudioType.Music applies when it is played. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/customization#default-easing) **Default Easing** The default easing function applies to the clip's Fade-In and Fade-Out. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/customization#seamless-loop-easing) **Seamless Loop Easing** The default easing function applies to the clip's Fade-In and Fade-Out while using a Seamless Loop. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/customization#project-settings) **Project Settings** **Max Real Voices** The Max Real Voices count the current project set. It's the same as in [Edit/Project Settings/Audioarrow-up-right](https://docs.unity3d.com/Manual/class-AudioManager.html) . \[Read-Only\] **Bro Virtual Tracks** Indicates the number of tracks utilized as backup tracks for virtual voices within the BroAudioMixer. This is \[Read-Only\] for now. **Auto-adding tracks to match audio voices** This button becomes available when BroAudioMixer has fewer tracks than **Max Real Voices + Bro Virtual Tracks**. Clicking the button will prompt BroAudioMixer to duplicate the last track until the total track count matches the target count (Max Real Voices + Bro Virtual Tracks). **Show VU Color On Volume Slider** Display a VU bar underneath the volume slider to indicate the sound level by a gradient color. **Show Master Volume On Clip List Header** Display the master volume slider on the clip list's header in the LibraryManager. **Show Audio Type On SoundID** Display a label to indicate the BroAudioType of an entity(soundID) on the inspector. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/customization#audiotype-color) **AudioType Color** Customize the label color of each BroAudioType, the options become available when **Show Audio Type On SoundID** is enabled. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/customization#displayed-properties) **Displayed Properties** Determines which entity's property will be displayed in the [LibraryManager](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager) by BroAudioType. This allows you to hide some properties that may not need to be set, focusing on those essential for that AudioType For example, [Music](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/broaudiotype) is often played "globally", meaning it's not tied to a specific spatial location. Therefore, no Spatial Setting is necessary. Additionally, the Pitch is typically left at its default setting, so it's not needed either." ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/customization#asset-output-path) Asset Output Path When an audio asset is created, it is saved to this path. You can change it by clicking this option. circle-info This option is also displayed in the LibraryManager window if the path is unavailable. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/customization#initialize-bro-audio-manually) Initialize Bro Audio Manually Enable this option if you want to initialize Bro Audio manually using the `BroAudio.Init()` method. When enabled, this toggle automatically adds or removes the `BroAudio_InitManually` define from the [**Scripting Define Symbols**arrow-up-right](https://docs.unity3d.com/2022.3/Documentation/Manual/CustomScriptingSymbols.html) in the Project Settings. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/customization#add-dominator-track) Add Dominator Track Determines how many DominatorPlayer can be played simultaneously. These tracks are directly connected to the "Master", without being affected by the "Main" track and any audio effects. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/core-features/customization#reset-to-factory-settings) Reset To Factory Settings Click to reset all preference settings to their defaults. Last updated 3 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Class | BroAudio [BroAudiochevron-right](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio) [BroAdvicechevron-right](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broadvice) Last updated 26 days ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Audio Mixer | BroAudio ![Page cover](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1466428996289-fb355538da1b%3Fcrop%3Dentropy%26cs%3Dsrgb%26fm%3Djpg%26ixid%3DM3wxOTcwMjR8MHwxfHNlYXJjaHw0fHxtaXhlcnxlbnwwfHx8fDE3MDQyNzc5MzV8MA%26ixlib%3Drb-4.0.3%26q%3D85&width=1248&dpr=3&quality=100&sign=fac2a9e8&sv=2) [hashtag](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer#introduction) Introduction ----------------------------------------------------------------------------------------------------------------- BroAudio uses a custom [Audio Mixerarrow-up-right](https://docs.unity3d.com/Manual/AudioMixer.html) with 32 tracks (matching Unity's default [Max Real Voices](https://man572142s-organization.gitbook.io/broaudio/reference/audio-terminology#real-voices-and-virtual-voices) ), plus 4 [virtual tracks](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer#virtual-tracks) , 4 [dominator](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/dominator-player) tracks, 1 effect track. This design offers great flexibility in controlling sounds and can prevent many common issues (e.g. [clipping](https://man572142s-organization.gitbook.io/broaudio/reference/audio-terminology#clipping) ). circle-check The BroAudioMixer is a fully pre-built asset that requires **no additional configuration**. This chapter is specifically intended for individuals who: * Need to customize the mixer. * Are eager to understand all the details. [hashtag](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer#the-mixer-design) The Mixer Design ------------------------------------------------------------------------------------------------------------------------- To guarantee that all [voices](https://man572142s-organization.gitbook.io/broaudio/reference/audio-terminology#real-voices-and-virtual-voices) can utilize features and be managed by BroAudio. the mixer includes 32 pre-built generic tracks. This number corresponds to Unity's default setting for [Max Real Voicesarrow-up-right](https://docs.unity3d.com/Manual/class-AudioManager.html) , and it should be readjusted if this setting is altered ([Bro can rematch them automatically](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer#matching-the-max-real-voices) ). ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer#virtual-tracks) Virtual Tracks Just as the 32 tracks are designated for 'Real' voices, 'Virtual' voices also require tracks to utilize features and be managed effectively. Although they are inaudible initially, they can become audible when a 'Real' voice ceases. To ensure continuity in their current processing or settings, maintaining a number of virtual tracks as a backup is essential. [hashtag](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer#customizing-the-broaudiomixer) Customizing The BroAudioMixer --------------------------------------------------------------------------------------------------------------------------------------------------- To customize the BroAudioMixer, you need to pay attention to the following few things: ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer#matching-the-max-real-voices) Matching the 'Max Real Voices' If you've changed the Max Real Voices in [Project Settingsarrow-up-right](https://docs.unity3d.com/Manual/class-AudioManager.html) to a value that is greater than 32, or you've deleted some tracks. Locate _**Tools > BroAudio > Preferences**_, and you should see a warning that indicates the unmatching voice count issue, and a button appears below, which could help you to match them (increase the track count) automatically, Just hit it! ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252FiYkzm0OzDS1Iyir6tfrM%252FMatchAudioTrack.png%3Falt%3Dmedia%26token%3Ddb34fbde-c187-4798-a64f-6ec91c9bf44c&width=768&dpr=3&quality=100&sign=7db7d680&sv=2) ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer#there-are-bugs-in-unity-audio-mixer-but-dont-worry-about-them) There are bugs in Unity Audio Mixer (But don't worry about them!) Yes, there are bugs in Unity which bro has already handled for you! You only need to be aware of the following things when you need further customization of BroAudioMixer; otherwise, it's not necessary. 1. [Error finding Parameter path message in Exposed Parameters](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer#error-finding-parameter-path-message-in-exposed-parameters) 2. [Send level beyond 0dB makes Audio Mixer slider disappear at runtime](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer#send-level-beyond-0db-makes-audio-mixer-slider-disappear-at-runtime) ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer#error-finding-parameter-path-message-in-exposed-parameters) Error finding Parameter path message in Exposed Parameters ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252F2LMohFpoVCucpLTmdAx7%252Fimage.png%3Falt%3Dmedia%26token%3Df99b0677-f937-4233-9ead-3ce0db9404b2&width=768&dpr=3&quality=100&sign=887daeec&sv=2) Don't worry about these error messages This message will be displayed on the Exposed Parameters of all "[Sendarrow-up-right](https://docs.unity3d.com/Manual/AudioMixerInspectors.html) " units, and this is the result produced by BroAudio after fixing this [Unity bugarrow-up-right](https://issuetracker.unity3d.com/issues/audio-mixer-unable-to-expose-other-send-level-parameters-when-one-is-already-exposed) . The bug causes the "Send" units to be unable to expose more than one Exposed Parameter, as they can only share the same instance and parameter. However, BroAudio requires these "Send" units to have their independent parameter. BroAudio has corrected this by assigning unique parameter paths to each unit. However, due to the persistence of the bug, the system may "incorrectly" flag these paths as erroneous. Fortunately, despite the error message, the functionality remains intact during runtime. Although this issue has been resolved in newer versions of Unity, it can still be reproduced if we build the Audio Mixer in a fixed version of Unity and then import it into an older version. Since the BroAudioMixer is a pre-built asset that must ensure compatibility across versions, this workaround is still in use. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer#send-level-beyond-0db-makes-audio-mixer-slider-disappear-at-runtime) Send level beyond 0dB makes Audio Mixer slider disappear at runtime This may not be a bug, but it has the potential to cause confusion. The problem is the "[Sendarrow-up-right](https://docs.unity3d.com/Manual/AudioMixerInspectors.html) " unit in Audio Mixer can only accept send level from -80 to 0dB, but it's actually capable of handling values up to +20dB, like the "Attenuation" unit's volume. If you see the send level's editor slider is gone, then again, **rest assured that their functions are still working properly!** ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer#audio-reverb-zone-issue-in-unity-2021) Audio Reverb Zone issue in Unity 2021 **Update:** This issue has been solved in ver. 1.01. The bug still exists, but Bro has redesigned the mixer to prevent it from happening. There is a bug that I encountered while developing BroAudio, which has been officially confirmed by Unity ([Issue Trackerarrow-up-right](https://issuetracker.unity3d.com/issues/audio-reverb-zone-component-is-not-applied-when-effects-are-reordered-in-the-mixer) ) after a bug report. **This could only be a concern for individuals who:** * Is using Unity 2021. * Need to use [AudioReverbZonearrow-up-right](https://docs.unity3d.com/Manual/class-AudioReverbZone.html) . The issue will cause the AudioReverbZone not to work, and it only occurs in Unity 2021. The problem is related to the 'Send' and 'Receive' units in the AudioMixer, and it can be reproduced in more ways than those listed on the issue tracker page. Last updated 9 months ago * [Introduction](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer#introduction) * [The Mixer Design](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer#the-mixer-design) * [Virtual Tracks](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer#virtual-tracks) * [Customizing The BroAudioMixer](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer#customizing-the-broaudiomixer) * [Matching the 'Max Real Voices'](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer#matching-the-max-real-voices) * [There are bugs in Unity Audio Mixer (But don't worry about them!)](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer#there-are-bugs-in-unity-audio-mixer-but-dont-worry-about-them) * [Error finding Parameter path message in Exposed Parameters](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer#error-finding-parameter-path-message-in-exposed-parameters) * [Send level beyond 0dB makes Audio Mixer slider disappear at runtime](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer#send-level-beyond-0db-makes-audio-mixer-slider-disappear-at-runtime) * [Audio Reverb Zone issue in Unity 2021](https://man572142s-organization.gitbook.io/broaudio/designs/audio-mixer#audio-reverb-zone-issue-in-unity-2021) sun-brightdesktopmoon sun-brightdesktopmoon --- # Technical Details | BroAudio [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/technical-details#the-audio-filter-design-in-broaudio) The Audio Filter Design in BroAudio ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- The [Low/High Pass Filterarrow-up-right](https://docs.unity3d.com/Manual/class-AudioLowPassFilter.html) 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. ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252FQ30hJYFOAmpQhun6ihHI%252FResonanceGain.png%3Falt%3Dmedia%26token%3D0746687f-bf56-431f-b82d-201a27b0eeb1&width=768&dpr=3&quality=100&sign=689c20da&sv=2) High Pass Filter with different Q values on Ableton Live's EQ Eight 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. For simplicity and stability reasons, Bro opts for the [Simple Low/High pass filterarrow-up-right](https://docs.unity3d.com/Manual/class-AudioLowPassSimpleEffect.html) —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. [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/technical-details#preventing-comb-filtering) Preventing Comb Filtering --------------------------------------------------------------------------------------------------------------------------------------------------- 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 [Comb Filtering](https://man572142s-organization.gitbook.io/broaudio/reference/audio-terminology#comb-filtering) . 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. * Using [Animation Blend Treesarrow-up-right](https://docs.unity3d.com/Manual/class-BlendTree.html) , where the animations use [Animation Eventarrow-up-right](https://docs.unity3d.com/Manual/script-AnimationWindowEvent.html) 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. circle-info Playing multiple sounds at the exact same time won't cause comb filtering, but it will result in one sound that is many times louder, which could cause distortion, this feature can also help with that. To address this, Bro Audio has implemented a preventive mechanism. If the same [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) is played again within this short period, it will be canceled. This behavior is controlled by the [**Playback Group**](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group) , which is available in all Audio Entities/Audio Assets, as well as in the default group set under _**Tools > BroAudio > Preferences**_. ![](https://man572142s-organization.gitbook.io/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252FLMEG5NNvzEWdpZIDXbiF%252FplaybackGroupInspector.png%3Falt%3Dmedia%26token%3D9c150814-c8a1-4678-b14d-f8326f1c541d&width=768&dpr=1&quality=100&sign=8a8a0350&sv=2) In the Playback Group, you'll find a field called **Comb Filtering Time**. This value defines the minimum interval allowed between two identical sounds. By default, it's set to 0.04 seconds (40ms). You can adjust this value to suit your needs, or disable the feature entirely by setting it to 0. For more details and advanced configuration options, please refer to the [**Rule And Value**](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group#rule-and-value) section of the PlaybackGroup page. Last updated 7 months ago * [The Audio Filter Design in BroAudio](https://man572142s-organization.gitbook.io/broaudio/reference/technical-details#the-audio-filter-design-in-broaudio) * [Preventing Comb Filtering](https://man572142s-organization.gitbook.io/broaudio/reference/technical-details#preventing-comb-filtering) sun-brightdesktopmoon sun-brightdesktopmoon --- # Audio Terminology | BroAudio [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/audio-terminology#comb-filtering) Comb Filtering ----------------------------------------------------------------------------------------------------------------------------- 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 Comb Filtering. Listen to the sound between 1ms to 20ms This article: [THE BASICS ABOUT COMB FILTERING (AND HOW TO AVOID IT)arrow-up-right](https://www.dpamicrophones.com/mic-university/the-basics-about-comb-filtering-and-how-to-avoid-it) provides further details. [Click here to see how BroAudio addresses this issue](https://man572142s-organization.gitbook.io/broaudio/reference/technical-details#preventing-comb-filtering) [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/audio-terminology#clipping) Clipping ----------------------------------------------------------------------------------------------------------------- Clipping is a distortion that occurs when a signal exceeds the maximum capacity of the system handling it. The exceeded signal will be cut off (data would be disregarded in a digital system), leading to harsh distortion. Generally, the maximum capacity is 0 dBFS in a digital audio system. [Clipping(audio) Wikipediaarrow-up-right](https://en.wikipedia.org/wiki/Clipping_(audio)) ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2F4%2F4e%2FClipping.svg%2F512px-Clipping.svg.png&width=768&dpr=3&quality=100&sign=a51ed5a3&sv=2) Clipping of a digital waveform. by [Gutten på Hemsenarrow-up-right](https://commons.wikimedia.org/wiki/User:Gutten_p%C3%A5_Hemsen) [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/audio-terminology#low-pass-filter) Low Pass Filter ------------------------------------------------------------------------------------------------------------------------------- Allows signals below a specified frequency to pass through while attenuating those above the specified frequency. **It can cause the sound to become relatively Muffled or Muddy. 🔔** In Unity, If the specified frequency is 22000Hz, it is the same as bypassing the filter. [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/audio-terminology#high-pass-filter) High Pass Filter --------------------------------------------------------------------------------------------------------------------------------- The opposite of a Low Pass Filter. **It can cause the sound to become relatively Thin and Crispy. 🔔** In Unity, If the specified frequency is 20Hz, it is the same as bypassing the filter. [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/audio-terminology#real-voices-and-virtual-voices) **Real Voices and Virtual Voices** ----------------------------------------------------------------------------------------------------------------------------------------------------------------- In every software and hardware system, the number of sounds (or voices) that can be played and be audible simultaneously is limited by the **"Real Voices"** count**.** When the number of sounds being played exceeds this limit, the excess sounds are converted into '**Virtual Voices**'. These virtual voices are inaudible during playback, but their playback process continues in the background. As soon as any of the real voices currently playing finishes, the corresponding virtual voice immediately becomes a real voice, thus becoming audible and continues to play until its end. For a more comprehensive understanding, I highly recommend the following article. [![Logo](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2Fgamedevbeginner.com%2Fwp-content%2Fuploads%2Fcropped-favicon-2-1-192x192.png&width=20&dpr=3&quality=100&sign=74121d78&sv=2)10 Unity Audio Optimisation Tips - Game Dev BeginnerGame Dev Beginnerchevron-right](https://gamedevbeginner.com/unity-audio-optimisation-tips/#voice_limits) Last updated 1 year ago * [Comb Filtering](https://man572142s-organization.gitbook.io/broaudio/reference/audio-terminology#comb-filtering) * [Clipping](https://man572142s-organization.gitbook.io/broaudio/reference/audio-terminology#clipping) * [Low Pass Filter](https://man572142s-organization.gitbook.io/broaudio/reference/audio-terminology#low-pass-filter) * [High Pass Filter](https://man572142s-organization.gitbook.io/broaudio/reference/audio-terminology#high-pass-filter) * [Real Voices and Virtual Voices](https://man572142s-organization.gitbook.io/broaudio/reference/audio-terminology#real-voices-and-virtual-voices) sun-brightdesktopmoon sun-brightdesktopmoon --- # BroAdvice | BroAudio NameSpace Accessibility Ami.BroAudio public [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broadvice#public-variables) Public Variables ------------------------------------------------------------------------------------------------------------------------------------------------- Variable Type Value FadeTime\_Immediate float 0 FadeTime\_Quick float 0.5 FadeTime\_Smooth float 1 LowPassFrequency float 300 HighPassFrequency float 2000 VolumeIncreaseEase [Ease](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease) [Ease](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease) .InCubic VolumeDecreaseEase [Ease](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease) [Ease](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease) .OutSine LowPassInEase [Ease](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease) [Ease](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease) .OutCubic LowPassOutEase [Ease](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease) [Ease](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease) .InCubic HighPassInEase [Ease](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease) [Ease](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease) .InCubic HighPassOutEase [Ease](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease) [Ease](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease) .OutCubic VirtualTrackCount int 4 Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Interface | BroAudio [IAudioPlayerchevron-right](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer) [IMusicPlayerchevron-right](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/imusicplayer) [IPlayerEffectchevron-right](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iplayereffect) [IAutoResetWaitablechevron-right](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iautoresetwaitable) Last updated 26 days ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Struct | BroAudio [SoundIDchevron-right](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) [Effectchevron-right](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/effect) [Fadingchevron-right](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/fading) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Duplicate SoundID Issue | BroAudio ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/known-issues/duplicate-soundid-issue#what-happened) What Happened? When an [AudioEntity](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager#entity) (sound) is created in BroAudio, it’s assigned a unique ID. This ID is guaranteed to be unique and cannot be duplicated. However, you might encounter duplicate IDs under the following conditions: * You duplicated an AudioEntity using the right-click menu or `Ctrl + D` in the Library Manager while using BroAudio versions **2.00 to 2.0.3**. Although this bug was fixed in [**2.0.4**](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver-2.0.4-unity-asset-store-github) , affected entities may still share the same SoundID unless resolved manually. * You experienced version control issues that caused two or more entities to end up with the same SoundID. Or you manually edited the SoundID via YAML or through debug mode in the Inspector. ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/known-issues/duplicate-soundid-issue#how-to-fix-this-issue) How to Fix This Issue * BroAudio will detect the issue and fix it automatically when assets are saved under the folder of "BroAudio" since [**2.0.6**](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver-2.0.6-unity-asset-store-github) . * If you're using a version **earlier than 2.0.6**, simply upgrading BroAudio will trigger the fix automatically when the assets are reimported. * To run the fix manually, go to: **Tools > BroAudio > Others > Fix Duplicate SoundIDs** If your project contains duplicate SoundIDs, a dialog window will appear after the fix is complete to notify you. If there are no issues, nothing will happen. ![](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2F886210201-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfI79StJ3o7OKZxf9vHhb%252Fuploads%252FJwN1OnRLPRjOQw4vyaNr%252FFixedDuplicateSoundIDs.png%3Falt%3Dmedia%26token%3D06b256c7-2220-480a-aba2-3417687ca8b8&width=768&dpr=3&quality=100&sign=fadad6b0&sv=2) Last updated 8 months ago * [What Happened?](https://man572142s-organization.gitbook.io/broaudio/others/known-issues/duplicate-soundid-issue#what-happened) * [How to Fix This Issue](https://man572142s-organization.gitbook.io/broaudio/others/known-issues/duplicate-soundid-issue#how-to-fix-this-issue) sun-brightdesktopmoon sun-brightdesktopmoon --- # Support & Contact | BroAudio [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/support-and-contact#join-our-discord-channel) Join our Discord channel ------------------------------------------------------------------------------------------------------------------------------------------------ [![Logo](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2Fdiscord.com%2Fassets%2Ffavicon.ico&width=20&dpr=3&quality=100&sign=846045aa&sv=2)加入 Bro Audio Discord 伺服器!Discordchevron-right](https://discord.gg/z6uNmz6Z3A) [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/support-and-contact#author) Author ------------------------------------------------------------------------------------------------------------ Author: Ami (阿咪) ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/support-and-contact#support-the-author) Support the author [![Logo](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2Fcdn.buymeacoffee.com%2Fstatic%2Fprod%2F11.4.0%2Fbuild%2Fassets%2Fapple-icon-180x180-912350ec.png&width=20&dpr=3&quality=100&sign=c0ce057f&sv=2)Ami is Bro AudioBuy Me a Coffeechevron-right](https://buymeacoffee.com/man572142) [![Logo](https://man572142s-organization.gitbook.io/broaudio/~gitbook/image?url=https%3A%2F%2Fwww.paypalobjects.com%2Fmarketing%2Fweb%2Ficons%2Fmonogram%2Fpp258.png&width=20&dpr=3&quality=100&sign=1eb14317&sv=2)Pay 翁 哲祥 using PayPal.MePayPal.Mechevron-right](https://paypal.me/man572142) Last updated 9 months ago * [Join our Discord channel](https://man572142s-organization.gitbook.io/broaudio/others/support-and-contact#join-our-discord-channel) * [Author](https://man572142s-organization.gitbook.io/broaudio/others/support-and-contact#author) * [Support the author](https://man572142s-organization.gitbook.io/broaudio/others/support-and-contact#support-the-author) sun-brightdesktopmoon sun-brightdesktopmoon --- # IAudioSourceProxy | BroAudio NameSpace Accessibility Ami.Extension public [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudiosourceproxy#description) Description --------------------------------------------------------------------------------------------------------------------------------------------------- This proxy represents the AudioSource component on the AudioPlayer. It allows you to access all the Unity APIs and properties freely. There’s nothing here but bindings to the AudioSource. [see the full list of the supported APIs](https://man572142s-organization.gitbook.io/broaudio/reference/unity-api-integration) ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudiosourceproxy#proxy-why-cant-just-give-us-the-audiosource-directly) Proxy? Why can't just give us the AudioSource directly? Since BroAudio utilized [object pooling](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player#object-pool) , we need to reset the AudioSource to its default in order to recycle and reuse safely. There are 3 possible ways to do that: 1\. [MonoBehaviour.Reset()arrow-up-right](https://docs.unity3d.com/ScriptReference/MonoBehaviour.Reset.html) ? ❌ AudioSource doesn’t inherit from MonoBehaviour 2. Destroy the component and add it again? ❌ That defeats the purpose of object pooling 3. Manually reset all properties ✅ seems like the way to go However, resetting all properties, even those that aren't modified, is inefficient. Unity is natively written in C++, and all C# APIs and properties eventually call the native side, which isn’t free — it produces GC. With around 30 properties in AudioSource, resetting them all after every play session could become an issue, especially since, in most cases, you might have dozens of sounds playing every second. The proxy class is created after the [IAudioPlayer.AudioSource](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#properties) is accessed, and it will record which property you've modified, and only reset them when the player is about to recycle. Last updated 1 year ago * [Description](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudiosourceproxy#description) * [Proxy? Why can't just give us the AudioSource directly?](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudiosourceproxy#proxy-why-cant-just-give-us-the-audiosource-directly) sun-brightdesktopmoon sun-brightdesktopmoon --- # Unity API Integration | BroAudio ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/unity-api-integration#public-methods) Public Methods Unity BroAudio Remarks [Playarrow-up-right](https://docs.unity3d.com/ScriptReference/AudioSource.Play.html) [BroAudio.Play](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#public-methods) (sound) [PlayClipAtPointarrow-up-right](https://docs.unity3d.com/ScriptReference/AudioSource.PlayClipAtPoint.html) [BroAudio.Play](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#public-methods) (sound, vector3) [Stoparrow-up-right](https://docs.unity3d.com/ScriptReference/AudioSource.Stop.html) [BroAudio.Stop](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#public-methods) , [**IAudioPlayer**.Stop](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#public-methods) [Pausearrow-up-right](https://docs.unity3d.com/ScriptReference/AudioSource.Pause.html) [**IAudioPlayer**.Pause](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#iaudiostoppable) [UnPausearrow-up-right](https://docs.unity3d.com/ScriptReference/AudioSource.UnPause.html) [**IAudioPlayer**.UnPause](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#iaudiostoppable) [GetOutputDataarrow-up-right](https://docs.unity3d.com/ScriptReference/AudioSource.GetOutputData.html) [**IAudioPlayer**.GetOutputData](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#public-methods) [GetSpectrumDataarrow-up-right](https://docs.unity3d.com/ScriptReference/AudioSource.GetSpectrumData.html) [**IAudioPlayer**.GetSpectrumData](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#public-methods) [GetCustomCurvearrow-up-right](https://docs.unity3d.com/ScriptReference/AudioSource.GetCustomCurve.html) [**IAudioPlayer**.AudioSource.GetCustomCurve](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#properties) [SetCustomCurvearrow-up-right](https://docs.unity3d.com/ScriptReference/AudioSource.SetCustomCurve.html) [**IAudioPlayer**.AudioSource.SetCustomCurve](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#properties) [PlayOneShotarrow-up-right](https://docs.unity3d.com/ScriptReference/AudioSource.PlayOneShot.html) \*audio clip only Consider using [SoundID.GetAudioClip()](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid#extension-method) to get the clip with the setting in LibraryManager, and then use it with vanilla AuidoSource API [PlayDelayedarrow-up-right](https://docs.unity3d.com/ScriptReference/AudioSource.PlayDelayed.html) [IAudioPlayer.SetDelay](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#ischedulable) , or use the delay option in the [LibraryManager](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#playback-position-in-seconds) [PlayScheduledarrow-up-right](https://docs.unity3d.com/ScriptReference/AudioSource.PlayScheduled.html) [**IAudioPlayer**.SetScheduledStartTime](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#ischedulable) [SetScheduledStartTimearrow-up-right](https://docs.unity3d.com/ScriptReference/AudioSource.SetScheduledStartTime.html) [**IAudioPlayer**.SetScheduledStartTime](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#ischedulable) [SetScheduledEndTimearrow-up-right](https://docs.unity3d.com/ScriptReference/AudioSource.SetScheduledEndTime.html) \*[**IAudioPlayer**.SetScheduledEndTime](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#ischedulable) [PlayOnGamepadarrow-up-right](https://docs.unity3d.com/ScriptReference/AudioSource.PlayOnGamepad.html) \*Not Supported [DisableGamepadOutputarrow-up-right](https://docs.unity3d.com/ScriptReference/AudioSource.DisableGamepadOutput.html) \*Not Supported [GetAmbisonicDecoderFloatarrow-up-right](https://docs.unity3d.com/ScriptReference/AudioSource.GetAmbisonicDecoderFloat.html) [**IAudioPlayer**.AudioSourcetAmbisonicDecoderFloat](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#properties) [SetAmbisonicDecoderFloatarrow-up-right](https://docs.unity3d.com/ScriptReference/AudioSource.SetAmbisonicDecoderFloat.html) [**IAudioPlayer**.AudioSourceetAmbisonicDecoderFloat](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#properties) [GetSpatializerFloatarrow-up-right](https://docs.unity3d.com/ScriptReference/AudioSource.GetSpatializerFloat.html) [**IAudioPlayer**.AudioSource.GetSpatializerFloat](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#properties) [SetSpatializerFloatarrow-up-right](https://docs.unity3d.com/ScriptReference/AudioSource.SetSpatializerFloat.html) [**IAudioPlayer**.AudioSource.SetSpatializerFloat](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#properties) Last updated 10 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # EffectType | BroAudio _**This enums use \[System.Flags\] attribute, so it could be used as a combination.**_ ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/effecttype#values) **Values** * None = 0 * Volume= 1 * LowPass = 2 * HighPass = 4 * All = Volume| LowPass | HighPass Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # StopMode | BroAudio ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/stopmode#values) Values * **Stop** Stop the current playback, and it will restart if played again. * **Pause** Pause the current playback, and it will resume from where it was paused if played again. * **Mute** Mute the current playback, it will keep playing in the background until it's played(Unmuted) again. Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Fading | BroAudio NameSpace Accessibility Ami.BroAudio public [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/fading#public-variables) Public Variables ----------------------------------------------------------------------------------------------------------------------------------------------- Variable Type Description **FadeIn** float The time duration of the fade-in process **FadeOut** float The time duration of the fade-out process **FadeInEase** [Ease](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease) The easing function of the fade-in process **FadeoutEase** [Ease](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease) The easing function of the fade-out process Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Known Issues | BroAudio [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/known-issues#error-...-broaudio-demo-scripts-preferenceoverrider.cs-25-43-error-cs1061-runtimesetting-does-not-co) Error: /.../BroAudio/Demo/Scripts/PreferenceOverrider.cs(25,43):error CS1061: 'RuntimeSetting' does not contain a definition for 'LogCombFilteringWarning'... ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- **Problem:** Both `PreferenceOverrider.cs` and the `LogCombFilteringWarning` field were removed in version 2.0.0. If you're upgrading from an older version, the unitypackage won’t automatically delete the `PreferenceOverrider` script after import, which leads to issues. **✅****Solution:** Remove the `PreferenceOverrider.cs` script, as it's no longer needed. [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/known-issues#warning-the-character-with-unicode-value-u2728-was-not-found-in-the-inter-regular-sdf-font-asset-or) 😯Warning: The character with Unicode value \\u2728 was not found in the \[Inter-Regular SDF\] font asset or any potential fallbacks. It was replaced by Unicode character \\u25A1 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ **Problem:** When opening BroAudio's description in the Package Manager, a warning is logged to the console indicating that some emojis are not supported by Unity's default font. This is a confirmed [Unity bugarrow-up-right](https://issuetracker.unity3d.com/issues/unicode-character-error-in-console-when-browsing-assets-in-package-manager) and mostly occurs in Unity 2022. **✅****Solution:** **This issue will not cause any problems**, so you can continue using BroAudio with confidence. * check ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/known-issues#error-invalidoperationexception-collection-was-modified-enumeration-operation-may-not-execute.-is-th) ~Error: "~~InvalidOperationException: Collection was modified; enumeration operation may not execute.~~" is thrown when calling BroAudio.Pause()~ ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/known-issues#fixed-in-2.1.0) [**Fixed in 2.1.0**](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver-2.1.0-github-unity-asset-store) * ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/known-issues#error-an-asset-is-marked-with-hideflags.dontsave-but-is-included-in-the-build-broaudio-core-resource) ~**Error:**~ ~"An asset is marked with HideFlags.DontSave but is included in the build: BroAudio/Core/Resources/Editor/Logo\_Main.png"~ [Fixed in 2.0.0](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver-2.0.0-unity-asset-store-github) * check ~Changing the master volume with a fadeTime of zero in WebGL doesn't work as expected~ [Fixed in 2.0.0](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver-2.0.0-unity-asset-store-github) Last updated 6 months ago * [Error: /.../BroAudio/Demo/Scripts/PreferenceOverrider.cs(25,43):error CS1061: 'RuntimeSetting' does not contain a definition for 'LogCombFilteringWarning'...](https://man572142s-organization.gitbook.io/broaudio/others/known-issues#error-...-broaudio-demo-scripts-preferenceoverrider.cs-25-43-error-cs1061-runtimesetting-does-not-co) * [😯Warning: The character with Unicode value \\u2728 was not found in the \[Inter-Regular SDF\] font asset or any potential fallbacks. It was replaced by Unicode character \\u25A1](https://man572142s-organization.gitbook.io/broaudio/others/known-issues#warning-the-character-with-unicode-value-u2728-was-not-found-in-the-inter-regular-sdf-font-asset-or) sun-brightdesktopmoon sun-brightdesktopmoon --- # Enums | BroAudio [BroAudioTypechevron-right](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/broaudiotype) [EffectTypechevron-right](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/effecttype) [StopModechevron-right](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/stopmode) [Transitionchevron-right](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/transition) [Easechevron-right](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # SoundSource | BroAudio NameSpace Accessibility Ami.BroAudio public [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/soundsource#public-variables) Public Variables --------------------------------------------------------------------------------------------------------------------------------------------------- Variable Type Description **CurrentPlayer** [IAudioPlyer](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer) The currently playing player **IsPlaying** bool Whether the CurrentPlayer is playing [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/soundsource#public-methods) Public Methods ----------------------------------------------------------------------------------------------------------------------------------------------- Method Return Parameters Description **Play** void [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id **Plays the audio base on the current PositionMode** void [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id, Vector3 position Plays audio in 3D space at the given position (SpatialBlend will be set to 3D automatically) void [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id, Transform followTarget Plays audio in 3D space and keeps it following the target continuously (SpatialBlend will be set to 3D automatically) **PlayGlobally** void [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id Plays audio globally (2D) **Stop** void Stop playing audio void float fadeOut Stop playing audio by the given fadeOut time **SetVolume** void float volume Immediately sets the volume of the currently playing player void float volume, float fadeTime Adjusts the volume of the currently playing player over the specified fade duration **SetPitch** void float pitch Immediately sets the pitch of the currently playing player void float pitch, [BroAudioType](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/broaudiotype) audioType Adjusts the pitch of the currently playing player over the specified fade duration Last updated 11 months ago * [Public Variables](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/soundsource#public-variables) * [Public Methods](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/soundsource#public-methods) sun-brightdesktopmoon sun-brightdesktopmoon --- # IMusicPlayer | BroAudio NameSpace Accessibility Ami.BroAudio public [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/imusicplayer#description) Description ---------------------------------------------------------------------------------------------------------------------------------------------- This is returned by the [AsBGM()](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/music-player#asbgm) method. It's basically the same as [IAudioPlayer](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer) , but it includes a SetTransition() method and excludes the AsBGM() method. [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/imusicplayer#public-methods) Public Methods ---------------------------------------------------------------------------------------------------------------------------------------------------- Method Return Parameters Description **SetTransition** [IMusicPlayer](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/imusicplayer) [Transition](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/transition) transition Set the transition mode that the music player will apply when playing the next BGM [Transition](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/transition) transition, float fadeTime Same as above, but can override the fade time set in LibarayManager [Transition](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/transition) transition, [StopMode](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/stopmode) stopMode Same as above, but can specify the StopMode [Transition](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/transition) transition, [StopMode](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/stopmode) stopMode, float fadeTime Same as above with all the parameters Last updated 1 year ago * [Description](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/imusicplayer#description) * [Public Methods](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/imusicplayer#public-methods) sun-brightdesktopmoon sun-brightdesktopmoon --- # IAutoResetWaitable | BroAudio NameSpace Accessibility Ami.BroAudio public [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iautoresetwaitable#public-methods) Public Methods ---------------------------------------------------------------------------------------------------------------------------------------------------------- Method Return Parameters Description **Until** [WaitUntilarrow-up-right](https://docs.unity3d.com/ScriptReference/WaitUntil.html) Func condition Wait until the given condition is met **While** [WaitWhilearrow-up-right](https://docs.unity3d.com/ScriptReference/WaitWhile.html) Func condition Wait while the given condition is true **ForSeconds** [WaitForSecondsarrow-up-right](https://docs.unity3d.com/ScriptReference/WaitForSeconds.html) float seconds Wait by the given time 🔔**This can be used as a yield return in Coroutine,** for example: Copy private bool _isUnderWater = false; public void EnterWater(bool isEnter) { _isUnderWater = isEnter; if(isEnter) { StartCoroutine(SetUnderWaterEffect()); } } private IEnumerator SetUnderWaterEffect() { yield return BroAudio.SetEffect(Effect.LowPass()) .WaitWhile(() => _isUnderWater = true); } Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Effect | BroAudio NameSpace Accessibility Ami.BroAudio public circle-exclamation The constructor of this struct is **internal**. Please use the static factory method for creation. This design provides a more organized and consistent parameter configuration and method names with clearer meanings. [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/effect#public-static-factory-method) Public Static Factory Method ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- Method Parameters Description **HighPass** float frequency, float fadeTime, [Ease](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease) ease = [BroAdvice](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broadvice) .HighPassInEase Create a [High Pass Filter](https://man572142s-organization.gitbook.io/broaudio/reference/audio-terminology#high-pass-filter) effect and set its frequency at the given value. **fadeTime:** The time duration from 20Hz to the given frequency. **ease(optional):** the ease function that applies while fading the frequency **ResetHighPass** float fadeTime, [Ease](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease) ease = [BroAdvice](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broadvice) .HighPassOutEase For resetting the [High Pass Filter](https://man572142s-organization.gitbook.io/broaudio/reference/audio-terminology#high-pass-filter) effect (back to 20Hz). **fadeTime:** The time duration from the current frequency to 20Hz. **LowPass** float frequency, float fadeTime, [Ease](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease) ease = [BroAdvice](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broadvice) .LowPassInEase Create a [Low Pass Filter](https://man572142s-organization.gitbook.io/broaudio/reference/audio-terminology#low-pass-filter) effect and set its frequency at the given value. **fadeTime:** The time duration from 22000Hz to the given frequency. **ease(optional):** the ease function that applies while fading the frequency **ResetLowPass** float frequency, float fadeTime, [Ease](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease) ease = [BroAdvice](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broadvice) .LowPassOutEase For resetting the [Low Pass Filter](https://man572142s-organization.gitbook.io/broaudio/reference/audio-terminology#low-pass-filter) effect (back to 22000Hz). **fadeTime:** The time duration from the current frequency to 22000Hz. **Custom** string exposedParameterName, float value, float fadeTime, [Ease](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease) ease = [Ease](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease) .Linear Create a custom effect. This is similar to using the [UnityAPI AudioMixer.SetFloat()arrow-up-right](https://docs.unity3d.com/ScriptReference/Audio.AudioMixer.SetFloat.html) , which requires adding an effect and exposing parameters in the AudioMixer. The only difference is that the effect referred to can only be applied to the 'Effect' track of BroAudioMixer, which can be set via [AudioEffectEditor](https://man572142s-organization.gitbook.io/broaudio/tools/audio-effect-editor) . Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Roadmap | BroAudio In Progress Planned Under Consideration **UPM support** #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/roadmap#improved-audio-effect-workflow) Improved Audio Effect workflow When using the `BroAudio.SetEffect()` API. We can use LowPass and HighPass effects without passing the "exposed parameter" string value; instead, we can simply pass the desired value. The Effect.Custom() method should operate in a similar manner. #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/roadmap#allowing-audioeffect-to-operate-on-multiple-sounds-individually) Allowing AudioEffect to Operate on Multiple Sounds Individually Currently, BroAudio only provides one Effect track, so it's not possible to add different Effects to various sounds individually. #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/roadmap#bro-audio-dynamic-reverb-solution) Bro Audio Dynamic Reverb Solution #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/roadmap#audio-occlusion) Audio Occlusion #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/roadmap#decibel-base-animation-curve-view) Decibel Base Animation Curve View #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/roadmap#adaptive-music) Adaptive Music Last updated 2 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # BroAudioType | BroAudio _**This enums use \[System.Flags\] attribute, so it could be used as a combination.**_ For example, BroAudio.SetVolume(BroAudioType.Music | BroAudioType.UI, 0.5f) ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/broaudiotype#values) Values * None = 0 * Music = 1 * UI = 2 * Ambience = 4 * SFX = 8 * VoiceOver = 16 * All = Music | UI | Ambience | SFX | VoiceOver Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # IPlayerEffect | BroAudio NameSpace Accessibility Ami.BroAudio public [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iplayereffect#description) Description ----------------------------------------------------------------------------------------------------------------------------------------------- This is returned by the [AsDominator()](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/dominator-player#asdominator) method. It's basically the same as [IAudioPlayer](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer) , but it includes 3 new methods and excludes the AsDominator() method. [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iplayereffect#public-methods) Public Methods ----------------------------------------------------------------------------------------------------------------------------------------------------- Method Return Parameters Description **QuietOthers** [IPlayerEffect](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iplayereffect) float othersVolume, float fadeTime = [0.5f](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broadvice) While this audio player is playing, the volume of other audio players will be lowered to the given volume float othersVolume, Fading fading Same as above, but can provide a custom fading setting **LowPassOthers** [IPlayerEffect](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iplayereffect) float frequency = [300f](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broadvice) , float fadeTime = [0.5f](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broadvice) While this audio player is playing, a lowpass filter will be added to other audio players (i.e. their higher frequencies will be cutted off) float frequency, Fading fading Same as above, but can provide a custom fading setting **HighPassOthers** [IPlayerEffect](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iplayereffect) float frequency = [2000f](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broadvice) , float fadeTime = [0.5f](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broadvice) While this audio player is playing, a highpass filter will be added to other audio players (i.e. their lower frequencies will be cutted off) float frequency, Fading fading Same as above, but can provide a custom fading setting Last updated 1 year ago * [Description](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iplayereffect#description) * [Public Methods](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iplayereffect#public-methods) sun-brightdesktopmoon sun-brightdesktopmoon --- # Transition | BroAudio ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/transition#values) Values * **Default** FadeOut the current sound first, then FadeIn the new one. * **Immediate** Immediately stop the current sound and play the new one without any transition. * **OnlyFadeIn** Immediately stop the current one, then FadeIn the new one. * **OnlyFadeOut** FadeOut the current one, then immediately play the new one. * **CrossFade** Start playing the next one with FadeIn while the previous one begins to FadeOut. circle-info More information is in the [Music Player](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/music-player#settransition-transition-transition-float-fadetime) section. Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Ease | BroAudio > Easing functions specify the rate of change of a parameter over time. To see more in actions, I reecommend [https://easings.net/arrow-up-right](https://easings.net/) ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease#values) Values * Linear * InQuad * InCubic * InQuart * InQuint * InSine * InCirc * OutQuad * OutCubic * OutQuart * OutQuint * OutSine * OutCirc * InOutQuad * InOutCubic * InOutQuart * InOutQuint * InOutSine * InOutCirc Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # SoundID | BroAudio NameSpace Accessibility Ami.BroAudio public [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid#public-variables) Public Variables ------------------------------------------------------------------------------------------------------------------------------------------------ Variable Type Description **ID** int A unique ID for an [Entity](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager#entity) [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid#extension-method) Extension Method ------------------------------------------------------------------------------------------------------------------------------------------------ Method Return Parameters Description **ToAudioType** [BroAudioType](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/broaudiotype) Convert ID to AudioType **ToName** string Get the [Entity](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager#entity) name of the ID **IsValid** bool Checks if this ID is available at runtime **GetAudioClip** [AudioCliparrow-up-right](https://docs.unity3d.com/ScriptReference/AudioClip.html) Get the AudioClip based on the [PlayMode](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound#playmode) setting of the [Entity](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager#entity) [AudioCliparrow-up-right](https://docs.unity3d.com/ScriptReference/AudioClip.html) int velocity Get the AudioClip based on the [Velocity](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/velocity) setting of the [Entity](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager#entity) **Play** [IAudioPlyer](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer) Same as [BroAudio.Play()](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#public-methods) [IAudioPlyer](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer) Vector3 position Same as [BroAudio.Play()](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#public-methods) [IAudioPlyer](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer) Transform followTarget Same as [BroAudio.Play()](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#public-methods) Last updated 1 year ago * [Public Variables](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid#public-variables) * [Extension Method](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid#extension-method) sun-brightdesktopmoon sun-brightdesktopmoon --- # BroAudio NameSpace Accessibility Ami.BroAudio public [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#public-methods) Public Methods -------------------------------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#playback) Playback Method Return Parameters Description **Play** [IAudioPlyer](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer) [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id Plays audio globally (2D) [IAudioPlyer](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer) [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id, float fadeIn Plays audio globally (2D) with fade-in. [IAudioPlyer](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer) [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id, Vector3 position Plays audio in 3D space at the given position (SpatialBlend will be set to 3D automatically) [IAudioPlyer](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer) [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id, Vector3 position, float fadeIn same as above but with fade-in. [IAudioPlyer](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer) [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id, Transform followTarget Plays audio in 3D space and keeps it following the target continuously (SpatialBlend will be set to 3D automatically) [IAudioPlyer](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer) [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id, Transform followTarget, float fadeIn same as above but with fade-in. **Stop** void [BroAudioType](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/broaudiotype) audioType Stop playing all audio that matches the given audio type void [BroAudioType](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/broaudiotype) audioType, float fadeOut Stop playing all audio that matches the given audio type by the given fadeOut time void [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id Stop playing audio void [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id, float fadeOut Stop playing audio by the given fadeOut time **Pause** void [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id Pause audio void [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id, float fadeOut Pause by the given fadeOut time **UnPause** void [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id Resume paused audio void [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id, float fadeIn Resume paused audio by the given fadeIn time [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#operations) Operations ------------------------------------------------------------------------------------------------------------------------------------ Method Return Parameters Description **SetVolume** void float volume Set the master volume Immediately void float volume, [BroAudioType](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/broaudiotype) audioType Set the volume of the given audio type Immediately void float volume, [BroAudioType](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/broaudiotype) audioType, float fadeTime Set the volume of the given audio type by the given fading time void [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id, float volume Set the volume of an audio void [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id, float volume, float fadeTime Set the volume of an audio by the given fading time **SetPitch** void float pitch Set all audio's pitch immediately void float pitch, [BroAudioType](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/broaudiotype) audioType Set the pitch of the given audio type immediately void float pitch, float fadeTime Set all audio's pitch by the given fading time void float pitch, [BroAudioType](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/broaudiotype) audioType, float fadeTime Set the pitch of the given audio type by the given fading time void [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id, float pitch Set the audio pitch immediately void [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id, float pitch, float fadeTime Set the audio pitch by the given fading time **SetEffect** [IAutoResetWaitable](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iautoresetwaitable) [Effect](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/effect) effect \*Use the static factory method for Effect such as Effect.LowPass() Set effect for all audio [IAutoResetWaitable](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iautoresetwaitable) [Effect](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/effect) effect, [BroAudioType](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/broaudiotype) audioType Set effect for all audio that matches the given audio type [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#others) Others ---------------------------------------------------------------------------------------------------------------------------- Method Return Parameters Description **HasAnyPlayingInstances** bool Check if a sound is currently playing anywhere **Init** void Initialize Bro Audio. Only required if the [**Initialize Bro Audio Manually**](https://man572142s-organization.gitbook.io/broaudio/core-features/customization#initialize-bro-audio-manually) option is enabled in the Preferences. **TryGetEntity** **Info** bool [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) id, out IReadOnlyAudioEntity entityInfo Retrieves a read-only view of the audio entity if available. [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#addressables) Addressables ---------------------------------------------------------------------------------------------------------------------------------------- see [Addressables](https://man572142s-organization.gitbook.io/broaudio/core-features/addressables#public-methods-in-broaudio-class) page Last updated 3 months ago * [Public Methods](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#public-methods) * [Playback](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#playback) * [Operations](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#operations) * [Others](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#others) * [Addressables](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#addressables) sun-brightdesktopmoon sun-brightdesktopmoon --- # IAudioPlayer | BroAudio NameSpace Accessibility Ami.BroAudio public [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#description) Description ---------------------------------------------------------------------------------------------------------------------------------------------- When [BroAudio.Play(id)](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#public-methods) is called, it returns an IAudioPlayer representing the AudioPlayer currently playing the audio. You can chain more methods after this, or cache the instance for later use. This interface is composed of several interfaces, including [IAudioStoppable](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#iaudiostoppable) , [IVolumeSettable](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#ivolumesettable) , [IEffectDecoratable](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#ieffectdecoratable) , [IMusicDecoratable](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#imusicdecoratable) . circle-exclamation The AudioPlayer has utilized the [ObjectPool design](https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player#object-pool) , which will recycle the AudioPlayer to the pool once it has finished its playing (or being stopped manually). If you've cached the instance of the AudioPlayer and tried to access it after it finished (recycled). To avoid accessing the wrong player, Bro will reject your access and log a warning to indicate the target player is unavailable. [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#properties) Properties -------------------------------------------------------------------------------------------------------------------------------------------- Property Type Description **ID** SoundID, int The [SoundID](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) that the player is playing **IsPlaying** bool Return true if the player's AudioSource is playing **IsActive** bool Returns true if the player is about to play or is playing **AudioSource** [IAudioSourceProxy](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudiosourceproxy) Gets the AudioSource component of the player **CurrentPlayingClip** IBroAudioClip Gets the clip that the player is playing ~**OnEndPlaying**~ **deprecated ** ~event Action<~[~SoundID~](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/audioid) ~\>~ ~Triggered when the audio player has finished playing~ [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#public-methods) Public Methods ---------------------------------------------------------------------------------------------------------------------------------------------------- Method Return Parameters Description **GetOutputData** void float\[\] samples, int channels Similar to [AudioSource.GetOutputDataarrow-up-right](https://docs.unity3d.com/ScriptReference/AudioSource.GetOutputData.html) , It's recommended to use this in [OnUpdate](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#event-messages) **GetSpectrumData** void float\[\] samples, int channels, [FFTWindow arrow-up-right](https://docs.unity3d.com/ScriptReference/FFTWindow.html) window Similar to[AudioSource.GetSpectrumDataarrow-up-right](https://docs.unity3d.com/ScriptReference/AudioSource.GetSpectrumData.html) , It's recommended to use this in [OnUpdate](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#event-messages) **SetPitch** IAudioPlayer float pitch Set the player's pitch. IAudioPlayer float pitch, float fadeTime Set the player's pitch by the given fade time **SetVelocity** IAudioPlayer int velocity Set the velocity to determine which audio clip to play **SetFadeInEase** IAudioPlayer [Ease](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease) ease Sets the fade in easing function for this player **SetFadeOutEase** IAudioPlayer [Ease](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/ease) ease Sets the fade out easing function for this player #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#event-messages) Event Messages Method Return Parameters Description **OnStart** IAudioPlayer Action Triggered when the AudioPlayer starts playing **OnUpdate** IAudioPlayer Action Triggered each frame while the AudioPlayer is playing **OnEnd** IAudioPlayer Action Triggered when the AudioPlayer stops playing **OnPause** IAudioPlayer Action Triggered when the AudioPlayer is paused **OnAudioFilterRead** IAudioPlayer Action Similar to [MonoBehaviourarrow-up-right](https://docs.unity3d.com/ScriptReference/MonoBehaviour.html) .OnAudioFilterRead(). ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#iaudiostoppable) IAudioStoppable Method Return Parameters Description **Stop** void none Stop playing the audio void Action onFinished Stop playing and trigger the action when it's finished void float fadeOut Stop playing the audio by the given fadeOut time void Action onFinished, float fadeOut Stop playing the audio by the given fadeOut time, and trigger the action when it's finished **Pause** void none Pause the audio void float fadeOut Pause by the given fadeOut time **UnPause** void none Resume the paused audio void float fadeIn Resume the paused audio by the given fadeIn time ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#ivolumesettable) IVolumeSettable Method Return Parameters Description **SetVolume** IAudioPlayer float volume Set the player's volume (acceptable range 0~10) void float volume, float fadeTime Set the player's volume by the given fadeTime ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#imusicdecoratable) IMusicDecoratable Method Return Parameters Description **AsBGM** [IMusicPlayer](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/imusicplayer) none Set the player as a music player, which will transition automatically if another BGM is played after it ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#ieffectdecoratable) IEffectDecoratable Method Return Parameters Description **AsDominator** [IPlayerEffect](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iplayereffect) none Set the player as a dominator player, which will affect or change the behavior of other audio players during its playback ### [hashtag](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#ischedulable) ISchedulable Method Return Parameters Description **SetScheduledStartTime** IAudioPlayer double dspTime Schedules the sound to start playing at a specific time on the absolute timeline that [AudioSettings.dspTimearrow-up-right](https://docs.unity3d.com/6000.0/Documentation/ScriptReference/AudioSettings-dspTime.html) reads from . **SetScheduledEndTime** IAudioPlayer double dspTime Changes the time at which a sound that has already been scheduled to play will end. **SetDelay** IAudioPlayer float time Delays the playback start time by the specified duration in seconds. Last updated 26 days ago * [Description](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#description) * [Properties](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#properties) * [Public Methods](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#public-methods) * [IAudioStoppable](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#iaudiostoppable) * [IVolumeSettable](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#ivolumesettable) * [IMusicDecoratable](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#imusicdecoratable) * [IEffectDecoratable](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#ieffectdecoratable) * [ISchedulable](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer#ischedulable) sun-brightdesktopmoon sun-brightdesktopmoon --- # Release Notes | BroAudio [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.2.2-github-unity-asset-store) **Ver. 2.2.2 (**[**Github**arrow-up-right](https://github.com/man572142/Bro_Audio/releases/tag/2.2.2) **,** [**Unity Asset Store**arrow-up-right](https://assetstore.unity.com/packages/tools/audio/bro-audio-257362) **)** -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- **New Features** * Added the OnPause() event to IAudioPlayer * Added a Prompt For Path On Asset Creation option to Preferences * Added drag-and-drop support for adding audio assets to the library asset list header **Fixes & Improvements** * Fixed an error that occurred when calling UnPause() on a player that was not paused * Fixed an issue where playback was not scheduled immediately * Fixed an exception when playing music in chained mode without an end clip * Fixed a missing HelpBox close button icon in Unity 6.2 * Removed obsolete API IAudioPlayer.OnEndPlaying (use OnEnd instead) * Use the clip directory as the default save path in the Clip Editor’s Save As dialog * Ensure UpdateVolume only runs after playback starts * Clarified the Additional Notes text for Setup Wizard configuration settings [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.2.1) **Ver. 2.2.1** ------------------------------------------------------------------------------------------------------------------ **New Features** * Added a fade-in parameter to the [Play()](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#playback) method for overriding a clip’s fade-in setting on start. * Added SetFadeInEase and SetFadeOutEase to IAudioPlayer for customizing fade easing functions. * Added [TryGetEntityInfo](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#others) for retrieving an AudioEntity’s settings. * Added a **Manual Initialization** option to **Preferences**. **Fixes & Improvements** * Made **Virtual Track Count** editable in [**Preferences**](https://man572142s-organization.gitbook.io/broaudio/core-features/customization) . * Fixed an issue where **comb-filtering prevention** wasn’t working properly. * Fixed **BGM** fading out unexpectedly on the first loop after a transition. * Fixed an issue where calling UnPause() unexpectedly altered the seamless loop’s fade-in time. [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.2.0) **Ver. 2.2.0** ------------------------------------------------------------------------------------------------------------------ **Setup Wizard** A quick wizard to help you set preferences so you don’t miss any of BroAudio’s customizable features. **Individual Audio Effects** You can now add audio effects to individual audio players using these new methods: * `AddChorusEffect` * `AddDistortionEffect` * `AddReverbEffect` * `AddEchoEffect` * `AddHighPassEffect` * `AddLowPassEffect` **This update also brings the** [**Low Pass Filter Curve**arrow-up-right](https://docs.unity3d.com/6000.1/Documentation/Manual/class-AudioLowPassFilter.html) **to the** [**Spatial Settings**](https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/spatial-and-mix#introduction) **.** _**Other New Features**_ * Drag and drop audio clips directly onto specific audio assets in the Library Manager. * Added a rule to skip comb filtering prevention when the audio source distance is greater than a specified value. * Added a closable help box to the Library Manager. #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#fixes-and-improvements) Fixes & Improvements * Improved volume slider binding to use normalized values. * Fixed an exception that occurred when previewing audio from the SoundID field while the Library Manager was open. #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#breaking-changes) Breaking Changes * The `IPlayableValidator.IsPlayable` method signature has changed to: `IsPlayable(SoundID id, Vector3 position)` * By default, the comb filtering rule is ignored when the distance between sounds is greater than 0.1. [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.1.1) **Ver. 2.1.1** ------------------------------------------------------------------------------------------------------------------ * Only schedule the AudioSource when a clip is assigned to avoid warnings in Unity 6 * Upgrade SoundID usage finder tool * Add null checks and refactor background logo handling [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.1.0) **Ver. 2.1.0** ------------------------------------------------------------------------------------------------------------------ **Chained Play Mode** Plays a start sound when triggered, then loops a base sound. An end sound is played when stopped. **Editor Audio Preview Improvements** The preview now responds in real time to volume and pitch adjustments, offering a smoother and more intuitive experience. * Added copy and paste support for AudioEntity properties ([gifarrow-up-right](https://cdn.discordapp.com/attachments/1159325793370001448/1378313619539890327/propertyCopyAndPaste.gif?ex=687eb9d6&is=687d6856&hm=f7e67207f347e796fe45b3d031627458d530ccf7725024239cfd01a753b7964b&) ) * Added a playback delay option when using "Play On Enable" in the **SoundSource** component * Added `SetPitch(SoundID)` method * Added `HasAnyPlayingInstances()` method to check if a sound is currently playing anywhere * Added a “Find SoundID Usage” tool in the editor ([screenshotarrow-up-right](https://media.discordapp.net/attachments/1159329242203570206/1396507366643470408/image.png?ex=687e5656&is=687d04d6&hm=ac48efedee32a25daa353b460dd6a83549a1779574169dc34d9084d4a0dd0b4e&=&format=webp&quality=lossless&width=734&height=629) ) * Added a context menu to the asset list in **LibraryManager** #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#fixes-and-improvements-1) Fixes & Improvements * Fixed exception thrown when calling `Pause()` a second time * Fixed an issue where the Clip Editor didn't reset values after saving * Fixed Clip Editor preferences not applying correctly * Fixed an issue where the `[Tooltip]` attribute was ignored on **SoundID** fields * Fixed Shuffle Play Mode not reselecting the last used clip after the first selection * Prevented unexpected clip changes caused by Unity reinitializing the `PropertyDrawer` [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.0.8) **Ver. 2.0.8** ------------------------------------------------------------------------------------------------------------------ * Fixed build failure caused by compilation errors [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.0.7) **Ver. 2.0.7** ------------------------------------------------------------------------------------------------------------------ * Fixed unpause not working as expected in `SoundSource` component * Fixed an issue where `SetScheduledEndTime` wasn't working as intended * Added `IsLoaded()` method for checking whether an entity is loaded by the Addressables * Added `SoundVolume` and `SpectrumAnalyzer` to the right-click game object creation menu * Added Pause/Unpause example to the demo scene * Improved the audio clip picking logic to prevent the clip sequencer and shuffle from updating when the audio clip is unavailable * Improved error handling for the audio player [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.0.6) **Ver. 2.0.6** ------------------------------------------------------------------------------------------------------------------ * Added an automatic process to fix duplicate SoundIDs. * Fixed LibraryManager unexpectedly getting focus after OnPostprocessAllAssets. * Exposed copy ID to clipboard feature. [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.0.5) **Ver. 2.0.5** ------------------------------------------------------------------------------------------------------------------ * Fixed an issue with the audio player object pool not working properly * Fixed an issue where the instance wrapper was not properly recycled * Slightly reduced the overhead of assigning an audio track to the audio player * Added editor support for user-customizable fields in SoundSource [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.0.4) **Ver. 2.0.4** ------------------------------------------------------------------------------------------------------------------ * Fixed an issue where copying or duplicating an entity resulted in an invalid `SoundID` [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.0.3) **Ver. 2.0.3** ------------------------------------------------------------------------------------------------------------------ #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#behavior-changes) Behavior Changes * The `Play()` method no longer resumes paused audio. Use `UnPause()` instead. #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#new-features) New Features * Added a configurable audio UpdateMode to support unscaled time transitions. * Added undo/redo functionality for volume adjustments in the Clip Editor. * Added `Pause()` and `UnPause()` methods to the `SoundSource` component. * Added a URP demo scene and reduced demo texture sizes. #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#fixes-and-improvements-2) Fixes & Improvements * GC has been significantly reduced across the asset. * Improved audio track handling by directly adjusting the volume on the `AudioSource` when all available audio tracks have been used up. * Fixed a `StackOverflowException` that occurred when the topmost rule was not overridden. * Fixed an issue where setting the master volume had no effect in WebGL. [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.0.2) **Ver. 2.0.2** ------------------------------------------------------------------------------------------------------------------ #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#behavior-changes-1) Behavior Changes * The `Play()` method on the **SoundSource** component has changed to use the current `Position Mode` settings instead of defaulting to global. * **SoundSource** component now stops the current playback before playing a new one to prevent losing control and reference to the previous play. #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#fixes-and-improvements-3) Fixes & Improvements * Added `PlayGlobally()` to **SoundSource** to play sounds globally, ignoring `Position Mode`. * Added missing Undo/Redo functionality to the ClipEditor. * Added `Pause()` and `UnPause()` public static methods with an audio type parameter. * Added open the last edited asset preference option for LibraryManager. * Added a preference setting for showing the play button when entities are collapsed in LibraryManager. * Exposed the override playback group on SoundSource component and added tooltips for all properties. * Fixed an issue where audio track changed unexpectedly after unpausing. * Fixed a LayoutWindow exception at project launch by removing an unnecessary asset-saving process. * Fixed comb filtering time not working correctly when set to zero. * Fixed a warning appearing incorrectly when SoundSource tried to display the debugging player. * Renamed and added a tooltip for the spatial setting field. * Removed the non-2D spatialBlend warning. * Improved public API summaries. [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.0.1) **Ver. 2.0.1** ------------------------------------------------------------------------------------------------------------------ * Fixed a stack overflow issue that occurred when no groups were assigned * Fixed an issue where [PlaybackGroup](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group) was unintentionally saved to the ScriptableObject in play mode * Fixed a conflict in LibraryManager where the Delete key was used for both deleting entities and removing object references * Fixed an issue where the dominator was not set to the correct track [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.0.0) **Ver. 2.0.0** ------------------------------------------------------------------------------------------------------------------ #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#new-features-1) New Features * Added [**Playback Group**](https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group) feature * Added support for [**Addressables**](https://man572142s-organization.gitbook.io/broaudio/core-features/addressables) * [**SpectrumAnalyzer**](https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/spectrum-analyzer) component is now fully released #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#new-apis) New APIs * Added `SetScheduledStartTime()` and `SetScheduledEndTime()` to **IAudioPlayer** for scheduling playback * Added `SetDelay()` to **IAudioPlayer** for delaying playback * Added `CurrentPlayingClip` property to **IAudioPlayer** for accessing clip information (e.g., `StartPosition`, `FadeOut`, etc.) * Added `IsPlaying()` property to **SoundSource** component #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#improvements) Improvements * Added a **\[None\]** option to the **SoundID** dropdown menu * Clicking on the label now expands an audio entity in Library Manager * Added right-click menus and shortcuts in LibraryManager for **duplicating** and **removing** entities * Implemented an automatic cleanup process for demo audio assets if they are not imported * Added **undo/redo** functionality to the **Preferences** window * Added editor preferences to the **Audio Clip Editor** * Reordered [`SetPitch()`](https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio#public-methods) method arguments to fix inconsistency with other APIs * Improved user data generation process * Various code refactoring and optimizations #### [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#fixes) Fixes * Fixed an issue where changing the master volume in WebGL did not work as expected * Fixed APIs that couldn't avoid accessing a recycled player * Fixed an issue where editor assets were mistakenly included in the build; they have been moved to **Editor/Resources** * Fixed **MusicPlayer** and **DominatorPlayer** not updating their instances during seamless looping * Fixed an issue where an audio player couldn't be stopped if it was still waiting for delayed playback [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.15) **Ver. 1.15** ---------------------------------------------------------------------------------------------------------------- * Fixed `Pause()` and `Stop()` method's override fadieTime doesn't work with a value of 0 * Fixed drag and drop with MultipleForEach option doesn't work as intended * Added a debug object reference to SoundID [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.14) **Ver. 1.14** ---------------------------------------------------------------------------------------------------------------- * Fixed `SoundID` doesn't work as intended when it's in an array * Fixed `OnEnd` is executed on the first loop of the play [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.13) **Ver. 1.13** ---------------------------------------------------------------------------------------------------------------- * Fixed the volume dominator that wasn't working as intended * Fixed the GUIStyle failing to initialize during project launch * Fixed player never finishes playing when the start position is greater than 0 * Improved BroAudioType check [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.12) **Ver. 1.12** ---------------------------------------------------------------------------------------------------------------- **Breaking Change** The minimum supported Unity version is now set to 2020.2, and the code base has been upgraded to C# 8.0. **Play Mode** * Added velocity play mode. * Added APIs for resetting clip sequence/shuffle data. **No-Code Components** * Added `SoundVolume` component to help create volume configurations without coding. * Added a preview version of `SpectrumAnalyzer` component. **API** * Added `GetAudioClip` and `Play` extension method to `SoundID`. * Added message type methods:`OnStart`, `OnUpdate`, `OnEnd`, and `OnAudioFilterRead` to `IAudioPlayer`. * Added audio analysis methods: `GetOutputData` and `GetSpectrumData` to `IAudioPlayer`. * Added `UnPause()` methods. * Added `AudioSourceProxy` to `IAudioPlayer` to safely access `AudioSource` and Unity APIs. * Deprecated `OnEndPlaying` event (replaced with `OnEnd`). **Other New Things** * Added a runtime-only audio player object field in the sound source inspector for debugging purposes. * Added expand/collapse all entities feature to `LibraryManager`. **Fixes and Improvements** * Fixed missing `BroAudioData` when upgrading from a different path. * Improved GUI UX and drawing precision. * Fixed issue where preview audio with pitch did not work as intended during fading processes. * Updated demo scene to showcase all new features. * Fixed slider float field clipping when the `[Volume]` and `[Frequency]` attributes were used in a sub-structure. * Improved shuffle picking algorithm to prevent repetition. [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.11) **Ver. 1.11** ---------------------------------------------------------------------------------------------------------------- * Fixed an issue where the fading used for BGM transitions was applied to later loops. * Fixed SoundID dropdown menu failed to open if there were any empty audio assets. * Fixed SoundManager would overwrite the current reference of BroAudioData after upgrading BroAudio. [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.10) **Ver. 1.10** ---------------------------------------------------------------------------------------------------------------- * Fixed issue where switching tabs in the LibraryManager caused the scroll position to change significantly. * Fixed SetEffect() with Dominator resulting the effect doesn’t get reset issue. * Fixed audioTypeVolume not resetting when the player finishes playing. * Added a preview button to the SoundID inspector. * Added an ID to the entity option menu for debugging purposes. * Added a fade-out setting for the “Stop On Disable” feature on the SoundSource. * Changed the audio player follow target design to fix the issue with players being destroyed. [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.09) **Ver. 1.09** ---------------------------------------------------------------------------------------------------------------- * Fixed SetVolume with fading doesn’t work as intended * Avoid making changes to source control after using the audio preview [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.08) **Ver. 1.08** ---------------------------------------------------------------------------------------------------------------- * Added LibraryManager shortcut to SoundID dropdown button in the inspector * Added SoundSource to GameObject menu item for easy creation * Added SoundSource replay mechanic * Fixed popup sound issue when previewing audio in the LibraryManger * Fixed audio type set volume not working as intended and refactored the volume system * Fixed set master volume in WebGL not working as intended * Tidy up script assemblies and namespaces * Performance optimizations and GC reduction [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.07) **Ver. 1.07** ---------------------------------------------------------------------------------------------------------------- * Fixed comb filtering prevention not working as intended * Change the logo file and GUID to avoid errors when building the project [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.06) **Ver. 1.06** ---------------------------------------------------------------------------------------------------------------- **Fixes** * Fixed changes to BroAudioData isn't saved to the disk * Fixed pitch setting does not apply to preview audio completely * Changed SoundSource script icon to the non-Editor one **Improvements** * Added WebGL constraint on volume attribute * Added a known issues page to the info window [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.05) **Ver. 1.05** ---------------------------------------------------------------------------------------------------------------- New Features * **Preview Audio**: Preview auido in edit-mode with the current setting like fade-in, fade-out, random… etc. * **Shuffle Play Mode**: Plays audio clips randomly, ensuring that no clip is repeated until all clips in the list have been played * **Quick AudioEnity Preference Setting**: a new button is added to the entity view in the LibraryManager, which allows you to remove entity, and change the displayed(exposed) properties setting of the AudioType New APIs and functionalities * **Added SetPitch() to BroAudio and IAudioPlayer**, and implemented it in the Demo * Added OnEndPlaying event to IAudioPlayer * Extended SoundID’s functionality * Added pitch attribute Improvements * **Implemented functionality to auto-generate user data to avoid overwriting existing data when upgrading BroAudio** * Reduced playback latency and improve accuracy by moving the play function from next frame to the end of the current frame * Added audio player pool size field to Preference and slightly improve the player pool performance * Always display(expose) non-default property value in the LibraryManager * Increased volume random range slider accuracy * Copied Logo\_Main.png to non-Editor folder and update Demo scene reference Fixes * Fixed compile error occur when building the project * Fixed comb filtering prevention rejecting all playback when Time.timeScale = 0 * Fixed SetVolume() not applying to the seamless loop * Fixed asset renaming doesn't work as intended after Unity 2023 * Fixed asset deleting doesn’t work as intended [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.04) **Ver. 1.04** ---------------------------------------------------------------------------------------------------------------- * Adjust the public methods of SoundSource to better match the intended design. * Improved the AudioPlyer object pool design to avoid accessing a recycled object. * Added a warning when trying to access a recycled player, and a preference setting related to it [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.03) **Ver. 1.03** ---------------------------------------------------------------------------------------------------------------- * Fix compile errors in WebGL [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.02) **Ver. 1.02** ---------------------------------------------------------------------------------------------------------------- * Fix errors occur if there are any missing auido assets when opening Library Manager * Fix error occurs when stopping a sound manually * Fix comb filitering cannot be disable * Fix error occurs after renaming a asset due to the unmatch filename issue * Change log comb filtering warning message’s default setting * Add a clickable link to documentation for comb filtering instruction * Add Stop() and Pause() methods to IAudioPlayer [hashtag](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.01) **Ver. 1.01** ---------------------------------------------------------------------------------------------------------------- * Solved the Unity 2021 Reverb Zone Issue * Fixed issue where entities could not be reordered in the LibraryManager * Removed BroLog.dll * Performance optimization on the editor Last updated 26 days ago * [Ver. 2.2.2 (Github, Unity Asset Store)](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.2.2-github-unity-asset-store) * [Ver. 2.2.1](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.2.1) * [Ver. 2.2.0](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.2.0) * [Ver. 2.1.1](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.1.1) * [Ver. 2.1.0](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.1.0) * [Ver. 2.0.8](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.0.8) * [Ver. 2.0.7](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.0.7) * [Ver. 2.0.6](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.0.6) * [Ver. 2.0.5](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.0.5) * [Ver. 2.0.4](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.0.4) * [Ver. 2.0.3](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.0.3) * [Ver. 2.0.2](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.0.2) * [Ver. 2.0.1](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.0.1) * [Ver. 2.0.0](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-2.0.0) * [Ver. 1.15](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.15) * [Ver. 1.14](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.14) * [Ver. 1.13](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.13) * [Ver. 1.12](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.12) * [Ver. 1.11](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.11) * [Ver. 1.10](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.10) * [Ver. 1.09](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.09) * [Ver. 1.08](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.08) * [Ver. 1.07](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.07) * [Ver. 1.06](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.06) * [Ver. 1.05](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.05) * [Ver. 1.04](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.04) * [Ver. 1.03](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.03) * [Ver. 1.02](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.02) * [Ver. 1.01](https://man572142s-organization.gitbook.io/broaudio/others/release-notes#ver.-1.01) sun-brightdesktopmoon sun-brightdesktopmoon ---