### Using BroAudioType Enum for Combined Audio Settings (C#) Source: https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/enums/broaudiotype Demonstrates how to use the BroAudioType enum with the [System.Flags] attribute to apply settings to multiple audio types at once. This example shows setting volume for Music and UI audio. ```csharp public enum BroAudioType { None = 0, Music = 1, UI = 2, Ambience = 4, SFX = 8, VoiceOver = 16, All = Music | UI | Ambience | SFX | VoiceOver } // Example usage: // BroAudio.SetVolume(BroAudioType.Music | BroAudioType.UI, 0.5f); ``` -------------------------------- ### Coroutine Wait Example using WaitWhile in C# Source: https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iautoresetwaitable Demonstrates how to use the WaitWhile method from BroAudio within a Unity coroutine to pause execution until a condition is met. This example shows how to apply an audio effect and wait while a boolean flag indicates the condition (being underwater) is true. ```csharp 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); } ``` -------------------------------- ### ISchedulable API Source: https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer Provides methods for scheduling the start and end times of audio playback, as well as introducing delays. ```APIDOC ## ISchedulable API ### Description Methods for scheduling audio playback times. ### Methods #### SetScheduledStartTime ##### Description Schedules the sound to start playing at a specific time on the absolute timeline. ##### Method POST ##### Endpoint /audio/schedule/start ##### Parameters ###### Query Parameters - **dspTime** (double) - Required - The absolute timeline time (AudioSettings.dspTime) at which to start playback. ##### Return IAudioPlayer #### SetScheduledEndTime ##### Description Changes the time at which a sound that has already been scheduled to play will end. ##### Method POST ##### Endpoint /audio/schedule/end ##### Parameters ###### Query Parameters - **dspTime** (double) - Required - The absolute timeline time (AudioSettings.dspTime) at which to end playback. ##### Return IAudioPlayer #### SetDelay ##### Description Delays the playback start time by the specified duration. ##### Method POST ##### Endpoint /audio/schedule/delay ##### Parameters ###### Query Parameters - **time** (float) - Required - The delay duration in seconds. ##### Return IAudioPlayer ``` -------------------------------- ### BroAudio Custom Curve Methods Source: https://man572142s-organization.gitbook.io/broaudio/reference/unity-api-integration Methods for getting and setting custom curves on the AudioSource. ```APIDOC ## POST /broaudio/curve ### Description Allows getting and setting custom curves on the AudioSource. These operations are performed through the IAudioPlayer interface. ### Method POST ### Endpoint /broaudio/curve ### Parameters #### Query Parameters - **action** (string) - Required - The action to perform. Possible values: "get", "set". - **curveType** (string) - Required - The type of curve. Example: "ல்", "ல்". - **curveData** (object) - Optional - The data for the custom curve, used when action is "set". ### Request Example ```json { "action": "set", "curveType": "ல்", "curveData": {"keys": [{"time": 0.0, "value": 0.0}, {"time": 1.0, "value": 1.0}]} } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. - **curveData** (object) - Optional - The retrieved curve data, present when action is "get". #### Response Example ```json { "status": "success", "curveData": {"keys": [{"time": 0.0, "value": 0.0}, {"time": 1.0, "value": 1.0}]} } ``` ``` -------------------------------- ### Add Audio Filter Effects to Individual Audio Players (C#) Source: https://man572142s-organization.gitbook.io/broaudio/core-features/audio-effect This example shows how to apply audio filter effects to individual audio instances using chaining methods on an `IAudioPlayer` object returned by `BroAudio.Play()`. It demonstrates adding a low-pass filter and multiple effects like reverb with specific configurations. ```csharp // 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); ``` -------------------------------- ### Initialize Rules in Playback Group (C#) Source: https://man572142s-organization.gitbook.io/broaudio/core-features/playback-group This C# code snippet shows how to override the InitializeRules method in a PlaybackGroup to set up and initialize the rules. It uses the Initialize method to associate rules with their evaluation delegates. ```csharp // Example from DefaultPlaybackGroup protected override IEnumerable InitializeRules() { yield return Initialize(_maxPlayableCount, IsPlayableLimitNotReached); yield return Initialize(_combFilteringTime, CheckCombFiltering); } ``` -------------------------------- ### Utility Operations Source: https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio Utility methods for checking audio status and initializing the BroAudio system. ```APIDOC ## GET /broaudio/has-playing-instances ### Description Checks if any sound is currently playing anywhere. ### Method GET ### Endpoint /broaudio/has-playing-instances ### Parameters #### Query Parameters - **id** (SoundID) - Required - The unique identifier for the sound to check. ### Response #### Success Response (200) - **isPlaying** (bool) - True if the sound is playing, false otherwise. #### Response Example ```json { "isPlaying": true } ``` ## POST /broaudio/init ### Description Initializes the Bro Audio system. This is only required if manual initialization is enabled in the project settings. ### Method POST ### Endpoint /broaudio/init ### Parameters (No parameters required) ### Response #### Success Response (200) - **message** (string) - Indicates successful initialization. #### Response Example ```json { "message": "Bro Audio initialized successfully." } ``` ## GET /broaudio/audio-entity-info ### Description Retrieves read-only information about a specific audio entity if available. ### Method GET ### Endpoint /broaudio/audio-entity-info ### Parameters #### Query Parameters - **id** (SoundID) - Required - The unique identifier for the audio entity. ### Response #### Success Response (200) - **entityInfo** (IReadOnlyAudioEntity) - An object containing read-only information about the audio entity, or null if not found. #### Response Example ```json { "entityInfo": { "name": "background_music", "isPlaying": true, "volume": 0.7 } } ``` ``` -------------------------------- ### Method Chaining for Audio Playback in BroAudio (C#) Source: https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation Demonstrates the Method Chaining design in BroAudio for playing sounds with chained behaviors like setting background music, transition effects, and volume. This approach enhances code conciseness and readability. ```csharp BroAudio.Play(_sound).AsBGM().SetTransition(Transition.CrossFade).SetVolume(0.8f); ``` -------------------------------- ### BroAudio Ambisonic and Spatializer Methods Source: https://man572142s-organization.gitbook.io/broaudio/reference/unity-api-integration Methods for managing ambisonic decoder and spatializer settings. ```APIDOC ## POST /broaudio/audio-settings ### Description Provides methods to get and set ambisonic decoder and spatializer settings for the AudioSource. These are accessed through the IAudioPlayer interface. ### Method POST ### Endpoint /broaudio/audio-settings ### Parameters #### Query Parameters - **settingType** (string) - Required - The type of setting to modify. Possible values: "ambisonicDecoderFloat", "spatializerFloat". - **action** (string) - Required - The action to perform. Possible values: "get", "set". - **value** (number) - Optional - The value to set for the setting, used when action is "set". ### Request Example ```json { "settingType": "ambisonicDecoderFloat", "action": "set", "value": 1.0 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. - **value** (number) - Optional - The retrieved value, present when action is "get". #### Response Example ```json { "status": "success", "value": 1.0 } ``` ``` -------------------------------- ### IAudioStoppable API Source: https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer Provides methods to control the playback state of an audio player, including stopping, pausing, and resuming. ```APIDOC ## IAudioStoppable API ### Description Methods for controlling audio playback. ### Methods #### Stop ##### Description Stops the audio playback. ##### Method POST ##### Endpoint /audio/stop ##### Parameters ###### Query Parameters - **onFinished** (Action) - Optional - Action to trigger when playback finishes. - **fadeOut** (float) - Optional - Time in seconds for fading out the audio. #### Pause ##### Description Pauses the audio playback. ##### Method POST ##### Endpoint /audio/pause ##### Parameters ###### Query Parameters - **fadeOut** (float) - Optional - Time in seconds for fading out the audio during pause. #### UnPause ##### Description Resumes the paused audio playback. ##### Method POST ##### Endpoint /audio/unpause ##### Parameters ###### Query Parameters - **fadeIn** (float) - Optional - Time in seconds for fading in the audio during resume. ``` -------------------------------- ### IVolumeSettable API Source: https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer Provides methods to set the volume of the audio player, with options for immediate or faded changes. ```APIDOC ## IVolumeSettable API ### Description Methods for controlling the audio player's volume. ### Methods #### SetVolume ##### Description Sets the player's volume. ##### Method POST ##### Endpoint /audio/volume ##### Parameters ###### Query Parameters - **volume** (float) - Required - The desired volume level (acceptable range 0-10). - **fadeTime** (float) - Optional - The time in seconds over which to transition to the new volume. ``` -------------------------------- ### BroAudio Playback Methods Source: https://man572142s-organization.gitbook.io/broaudio/reference/unity-api-integration Methods for playing sounds, including variations for playing at a specific position. ```APIDOC ## POST /broaudio/play ### Description Plays a sound using BroAudio. This method has an overload that accepts a Vector3 for playing at a specific position. ### Method POST ### Endpoint /broaudio/play ### Parameters #### Query Parameters - **sound** (string) - Required - The identifier for the sound to play. - **vector3** (object) - Optional - The position at which to play the sound. Example: `{"x": 1.0, "y": 2.0, "z": 3.0}` ### Request Example ```json { "sound": "my_sound_id", "vector3": {"x": 1.0, "y": 2.0, "z": 3.0} } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Play Sound with Global Settings using Bro Audio API Source: https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/spatial-and-mix Illustrates how to play a sound globally, ignoring all spatial settings, using the Bro Audio API. This is achieved by calling the Play method without position arguments, ensuring the sound is heard at full volume regardless of listener position. This is ideal for background music or UI sounds. ```csharp using BroAudio; // Play sound globally BroAudio.Play("SoundID"); ``` -------------------------------- ### Play Sound with Default Spatial Settings using Bro Audio API Source: https://man572142s-organization.gitbook.io/broaudio/core-features/library-manager/design-the-sound/spatial-and-mix Demonstrates how to play a sound in the scene with default spatial settings using Bro Audio's Play methods. These methods automatically set Spatial Blend to 1 (3D) and utilize default Unity AudioSource settings. This is useful for sounds that need to be positioned in the game world without manual configuration. ```csharp using BroAudio; // Play sound at a specific position BroAudio.Play("SoundID", new Vector3(10f, 0f, 5f)); // Play sound attached to a transform BroAudio.Play("SoundID", targetTransform); ``` -------------------------------- ### BroAudio Scheduling Methods Source: https://man572142s-organization.gitbook.io/broaudio/reference/unity-api-integration Methods for scheduling audio playback at specific times. ```APIDOC ## POST /broaudio/schedule ### Description Enables scheduling of audio playback, including setting delays and scheduled start/end times. This functionality is accessible via the IAudioPlayer interface. ### Method POST ### Endpoint /broaudio/schedule ### Parameters #### Query Parameters - **action** (string) - Required - The scheduling action. Possible values: "setDelay", "setScheduledStartTime", "setScheduledEndTime". - **time** (number) - Required - The time value for the scheduling action (e.g., delay in seconds, start time, end time). ### Request Example ```json { "action": "setScheduledStartTime", "time": 1678886400.0 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Set Spectrum Data Source via Code (C#) Source: https://man572142s-organization.gitbook.io/broaudio/core-features/no-code-components/spectrum-analyzer Demonstrates how to dynamically set the audio source for spectrum analysis using the SetSource method. This is useful when the SoundSource field is not assigned in the inspector. It requires an IAudioPlayer compatible object. ```csharp using BroAudio; // Assuming 'analyzer' is an instance of your Spectrum Analyzer component // and 'audioPlayer' is an object implementing IAudioPlayer analyzer.SetSource(audioPlayer); ``` -------------------------------- ### Set BGM Transition Settings Source: https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/music-player Configure the transition type and duration for BGM playback. This allows for customized audio transitions, overriding entity-specific fade settings if a fadeTime is provided. ```APIDOC ## POST /broaudio/bgm/transition ### Description Sets the transition type and fade time for background music playback. This allows for customized audio transitions between BGM entities. ### Method POST ### Endpoint /broaudio/bgm/transition ### Parameters #### Query Parameters - **transition** (Transition) - Required - The type of transition to use (e.g., Default, Immediate, OnlyFadeIn, OnlyFadeOut, CrossFade). - **fadeTime** (float) - Optional - The duration of the fade transition in seconds. If not set, entity-specific FadeIn/Out settings are used, followed by the transition mode. ### Request Example ```csharp BroAudio.Play(_id).SetTransition(Transition.CrossFade, 2.5f); ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation (e.g., "transition_set"). #### Response Example ```json { "status": "transition_set" } ``` ``` -------------------------------- ### Custom Effect Source: https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/struct/effect Creates a custom audio effect by specifying an exposed parameter name, a value, a fade time, and an optional ease function. This method is analogous to Unity's AudioMixer.SetFloat(). ```APIDOC ## POST /websites/man572142s-organization_gitbook_io_broaudio/effect/custom ### Description Creates a custom audio effect by setting an exposed parameter to a specific value over a given time. ### Method POST ### Endpoint /websites/man572142s-organization_gitbook_io_broaudio/effect/custom ### Parameters #### Query Parameters - **exposedParameterName** (string) - Required - The name of the exposed parameter in the AudioMixer. - **value** (float) - Required - The target value for the parameter. - **fadeTime** (float) - Required - The duration in seconds for the value to transition. - **ease** (Ease) - Optional - The easing function to apply during the fade. Defaults to Ease.Linear. ### Request Example ```json { "exposedParameterName": "MyCustomEffectParam", "value": 0.75, "fadeTime": 1.0, "ease": "Ease.InOutCubic" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the custom effect was created. #### Response Example ```json { "message": "Custom effect created successfully." } ``` ``` -------------------------------- ### Check if Entity is Loaded (C#) Source: https://man572142s-organization.gitbook.io/broaudio/others/release-notes This snippet demonstrates how to use the `IsLoaded()` method to check if an entity has been loaded by the Addressables system. It's useful for ensuring that assets are available before attempting to use them. ```csharp using BroAudio; // Assuming 'entity' is a valid entity reference if (SoundManager.Instance.IsLoaded(entity)) { // Entity is loaded, proceed with usage } else { // Entity is not loaded yet } ``` -------------------------------- ### Retrieve Audio Entity Information (Unity C#) Source: https://man572142s-organization.gitbook.io/broaudio/others/release-notes Provides a method to fetch the settings and information associated with a specific AudioEntity. This is useful for inspecting or modifying sound configurations at runtime. ```csharp TryGetEntityInfo() ``` -------------------------------- ### Check for Playing Instances (Unity C#) Source: https://man572142s-organization.gitbook.io/broaudio/others/release-notes A utility method to determine if any instances of a particular sound are currently playing across the project. This is helpful for managing audio states and preventing unintended overlaps. ```csharp HasAnyPlayingInstances() ``` -------------------------------- ### Audio Volume Operations Source: https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broaudio Methods for setting the master volume, volume for specific audio types, and volume for individual audio instances with optional fading. ```APIDOC ## POST /broaudio/volume/master ### Description Sets the master volume for all audio immediately. ### Method POST ### Endpoint /broaudio/volume/master ### Parameters #### Query Parameters - **volume** (float) - Required - The desired master volume level. ### Response #### Success Response (200) - **message** (string) - Indicates successful volume update. #### Response Example ```json { "message": "Master volume set to 0.8" } ``` ## POST /broaudio/volume/type ### Description Sets the volume for a specific audio type immediately or with a fade. ### Method POST ### Endpoint /broaudio/volume/type ### Parameters #### Query Parameters - **volume** (float) - Required - The desired volume level. - **audioType** (BroAudioType) - Required - The type of audio to adjust (e.g., Music, SFX). - **fadeTime** (float) - Optional - The time in seconds over which to fade to the new volume. ### Response #### Success Response (200) - **message** (string) - Indicates successful volume update for the specified audio type. #### Response Example ```json { "message": "Volume for SFX set to 0.7 with a fade time of 1.5 seconds" } ``` ## POST /broaudio/volume/id ### Description Sets the volume for a specific audio instance identified by its SoundID, with an optional fade time. ### Method POST ### Endpoint /broaudio/volume/id ### Parameters #### Query Parameters - **id** (SoundID) - Required - The unique identifier for the audio instance. - **volume** (float) - Required - The desired volume level. - **fadeTime** (float) - Optional - The time in seconds over which to fade to the new volume. ### Response #### Success Response (200) - **message** (string) - Indicates successful volume update for the specified audio instance. #### Response Example ```json { "message": "Volume for audio instance 'sound_123' set to 0.9" } ``` ``` -------------------------------- ### BroAudio Public Variables Source: https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/class/broadvice This section details the public variables within the Ami.BroAudio namespace, their types, and default values. ```APIDOC ## Public Variables ### Description This section details the public variables within the Ami.BroAudio namespace, their types, and default values. ### Method N/A (These are variable declarations, not API endpoints) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response #### Success Response (N/A) - **FadeTime_Immediate** (float) - The time in seconds for immediate fade operations. - **FadeTime_Quick** (float) - The time in seconds for quick fade operations. - **FadeTime_Smooth** (float) - The time in seconds for smooth fade operations. - **LowPassFrequency** (float) - The cutoff frequency for the low-pass filter in Hz. - **HighPassFrequency** (float) - The cutoff frequency for the high-pass filter in Hz. - **VolumeIncreaseEase** (Ease) - The easing function used for volume increases. - **VolumeDecreaseEase** (Ease) - The easing function used for volume decreases. - **LowPassInEase** (Ease) - The easing function used for low-pass filter in transitions. - **LowPassOutEase** (Ease) - The easing function used for low-pass filter out transitions. - **HighPassInEase** (Ease) - The easing function used for high-pass filter in transitions. - **HighPassOutEase** (Ease) - The easing function used for high-pass filter out transitions. - **VirtualTrackCount** (int) - The number of virtual tracks available. #### Response Example N/A ``` -------------------------------- ### IMusicDecoratable API Source: https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer Allows an audio player to be configured as a background music (BGM) player, enabling automatic transitions. ```APIDOC ## IMusicDecoratable API ### Description Decorates an audio player to function as a background music (BGM) player. ### Method POST ### Endpoint /audio/asBGM ### Description Sets the player as a music player, which will transition automatically if another BGM is played after it. ### Return IMusicPlayer ``` -------------------------------- ### IMusicPlayer - SetTransition Source: https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/imusicplayer Sets the transition mode for the music player when playing the next BGM. Overloads allow for specifying fade time and stop mode. ```APIDOC ## IMusicPlayer - SetTransition ### Description Sets the transition mode for the music player when playing the next BGM. This method allows for customization of how the current music fades out and the next track fades in. ### Method POST ### Endpoint /websites/man572142s-organization_gitbook_io_broaudio/core-features/audio-player/music-player ### Parameters #### Query Parameters - **transition** (Transition) - Required - The transition mode to apply (e.g., FADE_IN, FADE_OUT, CROSS_FADE). - **stopMode** (StopMode) - Optional - The mode to use when stopping the current track (e.g., IMMEDIATE, FADE_OUT). - **fadeTime** (float) - Optional - The duration in seconds for the fade effect. If not provided, the default fade time from LibraryManager will be used. ### Request Example ```json { "transition": "CROSS_FADE", "stopMode": "FADE_OUT", "fadeTime": 2.5 } ``` ### Response #### Success Response (200) - **IMusicPlayer** (object) - An object representing the updated music player state. #### Response Example ```json { "message": "Transition set successfully." } ``` ``` -------------------------------- ### Set BGM Transition in C# Source: https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/music-player Configures the transition type and duration for BGM playback. Allows specifying how the current music fades out and the new music fades in. If fadeTime is not set, entity-specific FadeIn/FadeOut settings are used. ```csharp BroAudio.Play(_id).SetTransition(Transition.CrossFade, 2.0f); BroAudio.Play(_id).SetTransition(Transition.Immediate); BroAudio.Play(_id).SetTransition(Transition.OnlyFadeIn); BroAudio.Play(_id).SetTransition(Transition.OnlyFadeOut); BroAudio.Play(_id).SetTransition(Transition.Default, 1.5f); ``` -------------------------------- ### IEffectDecoratable API Source: https://man572142s-organization.gitbook.io/broaudio/reference/api-documentation/interface/iaudioplayer Allows an audio player to be configured as a dominator player, affecting the behavior of other audio players. ```APIDOC ## IEffectDecoratable API ### Description Decorates an audio player to function as a dominator player. ### Method POST ### Endpoint /audio/asDominator ### Description Sets the player as a dominator player, which will affect or change the behavior of other audio players during its playback. ### Return IPlayerEffect ``` -------------------------------- ### Add Individual Audio Effects to Players (Unity C#) Source: https://man572142s-organization.gitbook.io/broaudio/others/release-notes Demonstrates how to apply various audio effects to individual audio players using BroAudio's API. These methods allow for fine-grained control over audio processing for specific sound instances. ```csharp AddChorusEffect() AddDistortionEffect() AddReverbEffect() AddEchoEffect() AddHighPassEffect() AddLowPassEffect() ``` -------------------------------- ### Pause and Unpause Audio (C#) Source: https://man572142s-organization.gitbook.io/broaudio/others/release-notes This C# code demonstrates how to pause and unpause audio playback using the `SoundSource` component. It highlights the `Pause()` and `UnPause()` methods, which are essential for controlling audio flow. ```csharp using BroAudio; // Assuming 'soundSource' is an instance of SoundSource // To pause soundSource.Pause(); // To unpause soundSource.UnPause(); // Static methods for pausing/unpausing specific audio types SoundManager.Instance.Pause(AudioType.SoundEffect); SoundManager.Instance.UnPause(AudioType.Music); ``` -------------------------------- ### Play Sound Globally (C#) Source: https://man572142s-organization.gitbook.io/broaudio/others/release-notes This C# code shows how to play a sound globally, ignoring the `Position Mode` settings of the `SoundSource` component. The `PlayGlobally()` method is useful for sounds that should not be affected by listener position. ```csharp using BroAudio; // Assuming 'soundSource' is an instance of SoundSource // Play the sound globally soundSource.PlayGlobally(); ``` -------------------------------- ### BroAudio Control Methods Source: https://man572142s-organization.gitbook.io/broaudio/reference/unity-api-integration Methods for controlling audio playback, such as stopping, pausing, and resuming. ```APIDOC ## POST /broaudio/control ### Description Provides methods to control audio playback, including stopping, pausing, and unpausing sounds. These methods may also be available through the IAudioPlayer interface. ### Method POST ### Endpoint /broaudio/control ### Parameters #### Query Parameters - **action** (string) - Required - The action to perform. Possible values: "stop", "pause", "unpause". - **target** (string) - Optional - Specifies the target for the action, e.g., "BroAudio" or "IAudioPlayer". Defaults to "BroAudio" if not specified. ### Request Example ```json { "action": "stop" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Play Music as BGM in C# Source: https://man572142s-organization.gitbook.io/broaudio/core-features/audio-player/music-player Plays a specified sound ID as background music (BGM) using the BroAudio library. This method ensures seamless transitions and manages audio playback as a single BGM entity. The sound does not need to be of type BroAudioType.Music. ```csharp BroAudio.Play(_id).AsBGM(); ```