Master Audio - AAA Sound Solution! v2024
The ultimate AAA audio config tool
Loading...
Searching...
No Matches
DarkTonic.MasterAudio.MasterAudio Class Reference

This class contains the heart of the Master Audio API. There are also convenience methods here for Playlist Controllers, even though you can call those methods on the Playlist Controller itself as well. More...

Inheritance diagram for DarkTonic.MasterAudio.MasterAudio:

Public Types

enum  AudioLocation
 This setting lets you choose where the Audio Clip lives: Clip, Resource File or Addressable
 
enum  CustomSongStartTimeMode
 This controls where the song starts, Beginning, Specific Time or Random Time.
 

Static Public Member Functions

static bool PlaySoundAndForget (string sType, float volumePercentage=1f, float? pitch=null, float delaySoundTime=0f, string variationName=null, double? timeToSchedulePlay=null, bool isChaining=false)
 This method allows you to play a sound in a Sound Group in the location of the Master Audio prefab. Returns bool indicating success (played) or not. More...
 
static PlaySoundResult PlaySound (string sType, float volumePercentage=1f, float? pitch=null, float delaySoundTime=0f, string variationName=null, double? timeToSchedulePlay=null, bool isChaining=false, bool isSingleSubscribedPlay=false)
 This method allows you to play a sound in a Sound Group in the location of the Master Audio prefab. Returns a PlaySoundResult object. More...
 
static bool PlaySound3DAtVector3AndForget (string sType, Vector3 sourcePosition, float volumePercentage=1f, float? pitch=null, float delaySoundTime=0f, string variationName=null, double? timeToSchedulePlay=null)
 This method allows you to play a sound in a Sound Group from a specific Vector 3 position. Returns bool indicating success (played) or not. More...
 
static PlaySoundResult PlaySound3DAtVector3 (string sType, Vector3 sourcePosition, float volumePercentage=1f, float? pitch=null, float delaySoundTime=0f, string variationName=null, double? timeToSchedulePlay=null)
 This method allows you to play a sound in a Sound Group from a specific Vector3 position. Returns a PlaySoundResult object. More...
 
static bool PlaySound3DAtTransformAndForget (string sType, Transform sourceTrans, float volumePercentage=1f, float? pitch=null, float delaySoundTime=0f, string variationName=null, double? timeToSchedulePlay=null, bool isChaining=false)
 This method allows you to play a sound in a Sound Group from a specific position - the position of a Transform you pass in. Returns bool indicating success (played) or not. More...
 
static PlaySoundResult PlaySound3DAtTransform (string sType, Transform sourceTrans, float volumePercentage=1f, float? pitch=null, float delaySoundTime=0f, string variationName=null, double? timeToSchedulePlay=null, bool isChaining=false, bool isSingleSubscribedPlay=false)
 This method allows you to play a sound in a Sound Group from a specific position - the position of a Transform you pass in. More...
 
static bool PlaySound3DFollowTransformAndForget (string sType, Transform sourceTrans, float volumePercentage=1f, float? pitch=null, float delaySoundTime=0f, string variationName=null, double? timeToSchedulePlay=null, bool isChaining=false)
 This method allows you to play a sound in a Sound Group from a specific position - a Transform you pass in. Returns bool indicating success (played) or not. More...
 
static PlaySoundResult PlaySound3DFollowTransform (string sType, Transform sourceTrans, float volumePercentage=1f, float? pitch=null, float delaySoundTime=0f, string variationName=null, double? timeToSchedulePlay=null, bool isChaining=false, bool isSingleSubscribedPlay=false)
 This method allows you to play a sound in a Sound Group from a specific position - a Transform you pass in, and it will follow the Transform if it moves. Returns a PlaySoundResult. More...
 
static IEnumerator PlaySoundAndWaitUntilFinished (string sType, float volumePercentage=1f, float? pitch=null, float delaySoundTime=0f, string variationName=null, System.Action completedAction=null)
 This method allows you to play a sound in a Sound Group from the location of Master Audio. This method will not return until the sound is finished (or cannot play) to continue execution. You need to call this with StartCoroutine. The sound will not be played looped, since that could cause a Coroutine that would never end. More...
 
static IEnumerator PlaySound3DAtTransformAndWaitUntilFinished (string sType, Transform sourceTrans, float volumePercentage=1f, float? pitch=null, float delaySoundTime=0f, string variationName=null, double? timeToSchedulePlay=null, System.Action completedAction=null)
 This method allows you to play a sound in a Sound Group from a specific position - a Transform you pass in. This method will not return until the sound is finished (or cannot play) to continue execution. You need to call this with StartCoroutine. The sound will not be played looped, since that could cause a Coroutine that would never end. More...
 
static IEnumerator PlaySound3DFollowTransformAndWaitUntilFinished (string sType, Transform sourceTrans, float volumePercentage=1f, float? pitch=null, float delaySoundTime=0f, string variationName=null, double? timeToSchedulePlay=null, System.Action completedAction=null)
 This method allows you to play a sound in a Sound Group from a specific position - a Transform you pass in, and it will follow the Transform if it moves. This method will not return until the sound is finished (or cannot play) to continue execution. You need to call this with StartCoroutine. The sound will not be played looped, since that could cause a Coroutine that would never end. More...
 
static void StopAllSoundsOfTransform (Transform sourceTrans)
 This method allows you to abruptly stop all sounds triggered by or following a Transform. More...
 
static void StopSoundGroupOfTransform (Transform sourceTrans, string sType)
 This method allows you to abruptly stop all sounds of a particular Sound Group triggered by or following a Transform. More...
 
static void PauseAllSoundsOfTransform (Transform sourceTrans)
 This method allows you to pause all sounds triggered by or following a Transform. More...
 
static void PauseSoundGroupOfTransform (Transform sourceTrans, string sType)
 This method allows you to pause all sounds of a particular Sound Group triggered by or following a Transform. More...
 
static void UnpauseAllSoundsOfTransform (Transform sourceTrans)
 This method allows you to unpause all sounds triggered by or following a Transform. More...
 
static void UnpauseSoundGroupOfTransform (Transform sourceTrans, string sType)
 This method allows you to unpause all sounds of a particular Sound Group triggered by or following a Transform. More...
 
static void FadeOutAllSoundsOfTransform (Transform sourceTrans, float fadeTime)
 This method allows you to fade out all sounds triggered by or following a Transform for X seconds. More...
 
static void FadeOutSoundGroupOfTransform (Transform sourceTrans, string sType, float fadeTime)
 This method allows you to fade out all sounds of a particular Sound Group triggered by or following a Transform for X seconds. More...
 
static void FadeSoundGroupOfTransformToVolume (Transform sourceTrans, string sType, float fadeTime, float targetVolume)
 This method allows you to fade a certain Sound Group triggered by or following a Transform to a target volume over a period of time. More...
 
static void StopAllOfSound (string sType)
 This method allows you to abruptly stop all sounds in a specified Sound Group. More...
 
static void FadeOutAllOfSound (string sType, float fadeTime)
 This method allows you to fade out all sounds in a specified Sound Group for X seconds. This uses each Variation's fade command. If you want to Fade a Sound Group with the Group volume, use FadeSoundGroupToVolume More...
 
static List< SoundGroupVariationGetAllPlayingVariations ()
 Returns a list of all Variation scripts that are currently playing a sound. More...
 
static List< SoundGroupVariationGetAllPlayingVariationsOfTransform (Transform sourceTrans)
 This will return a list of all playing Variations of a Transform More...
 
static List< SoundGroupVariationGetAllPlayingVariationsOfTransformList (List< Transform > sourceTransList)
 This will return a list of all playing Variations of a list of Transforms More...
 
static List< SoundGroupVariationGetAllPlayingVariationsInBus (string busName)
 Returns a list of all Variation scripts that are currently playing through a bus. More...
 
static void DeleteGroupVariation (string sType, string variationName)
 This method will delete a variation from a Sound Group during runtime. More...
 
static void CreateGroupVariationFromClip (string sType, AudioClip clip, string variationName, float volume=1f, float pitch=1f)
 This method will add the variation to a Sound Group during runtime. More...
 
static void ChangeVariationPitch (string sType, bool changeAllVariations, string variationName, float pitch)
 This method will change the pitch of a variation or all variations in a Sound Group. More...
 
static void ChangeVariationVolume (string sType, bool changeAllVariations, string variationName, float volume)
 This method will change the volume of a variation or all variations in a Sound Group. More...
 
static void ChangeVariationClipFromResources (string sType, bool changeAllVariations, string variationName, string resourceFileName)
 This method will change the Audio Clip used by a variation into one named from a Resource file. More...
 
static void ChangeVariationClip (string sType, bool changeAllVariations, string variationName, AudioClip clip)
 This method will change the Audio Clip used by a variation into one you specify. More...
 
static void GradualOcclusionFreqChange (SoundGroupVariation variation, float fadeTime, float newCutoffFreq)
 This method will gradually change the cutoff frequency of an occluded Variation
 
static AudioSource GetNextVariationForSoundGroup (string sType)
 This returns the AudioSource for the next Variation to be played. Only works for top-to-bottom Variation Sequence. More...
 
static bool IsSoundGroupPlaying (string sType)
 Returns true or false, telling you true if a Sound Group is playing any voices. More...
 
static bool IsTransformPlayingSoundGroup (string sType, Transform sourceTrans)
 Will return whether the Sound Group you specify is played by a Transform you pass in. More...
 
static void RouteGroupToBus (string sType, string busName)
 Change the bus of a Sound Group. More...
 
static float GetVariationLength (string sType, string variationName)
 This method will return the length in seconds of a Variation in a Sound Group. Note that it only works for Clip type, not Resource Files or Addressables. More...
 
static void RefillSoundGroupPool (string sType)
 This method allows you to refill the pool of the Variation sounds for a Sound Group. That way you don't have to wait for all remaining random (or top to bottom) sounds to be played before it refills. More...
 
static bool SoundGroupExists (string sType)
 This method allows you to check if a Sound Group exists. More...
 
static void PauseSoundGroup (string sType)
 This method allows you to pause all Audio Sources in a Sound Group. More...
 
static void UnpauseSoundGroup (string sType)
 This method allows you to unpause all Audio Sources in a Sound Group. More...
 
static void FadeSoundGroupToVolume (string sType, float newVolume, float fadeTime, System.Action completionCallback=null, bool willStopAfterFade=false, bool willResetVolumeAfterFade=false)
 This method allows you to fade the volume of a Sound Group over X seconds. More...
 
static void FadeOutOldSoundGroupVoices (string sType, float minimumPlayTime, float fadeTime)
 This method allows you to fade out voices on a Sound Group that have been playing for at least X seconds. More...
 
static void StopOldSoundGroupVoices (string sType, float minimumPlayTime)
 This method allows you to stop voices on a Sound Group that have been playing for at least X seconds. More...
 
static void GlideSoundGroupByPitch (string sType, float pitchAddition, float glideTime, System.Action completionCallback=null)
 This method allows you to glide the pitch of each Variation of a Sound Group over X seconds by a specified amount. More...
 
static void DeleteSoundGroup (string sType)
 This method will delete a Sound Group, and all variations from the current Scene's Master Audio object. More...
 
static Transform CreateSoundGroup (DynamicSoundGroup aGroup, int? creatorInstanceId, bool errorOnExisting=true)
 This method will create a new Sound Group from the Audio Clips you pass in. More...
 
static float GetGroupVolume (string sType)
 This will return the volume of a Sound Group. More...
 
static void SetGroupVolume (string sType, float volumeLevel)
 This method will set the volume of a Sound Group. More...
 
static void MuteGroup (string sType, bool shouldCheckMuteStatus=true)
 This method will mute all variations in a Sound Group. More...
 
static void UnmuteGroup (string sType, bool shouldCheckMuteStatus=true)
 This method will unmute all variations in a Sound Group More...
 
static void SoloGroup (string sType, bool shouldCheckMuteStatus=true)
 This method will solo a Sound Group. If anything is soloed, only soloed Sound Groups will be heard. More...
 
static void UnsoloGroup (string sType, bool shouldCheckMuteStatus=true)
 This method will unsolo a Sound Group. More...
 
static MasterAudioGroup GrabGroup (string sType, bool logIfMissing=true)
 This method will return the Sound Group settings for examination purposes. More...
 
static int VoicesForGroup (string sType)
 Returns total number of Audio Sources for this Sound Group. More...
 
static AudioGroupInfo GetGroupInfo (string sType)
 This method will return the Audio Group Info settings for examination purposes. Use on during play in editor, not during edit. More...
 
static void SubscribeToLastVariationPlayed (string sType, System.Action finishedCallback)
 Use this method if you want to be notified when the last Variation in a Sound Group has finished playing (all have played). More...
 
static void UnsubscribeFromLastVariationPlayed (string sType)
 Use this method to cease notifications added by SubscribeToLastVariationPlayed. More...
 
static void PauseMixer ()
 This method allows you to pause all Audio Sources in the mixer (everything but Playlists).
 
static void UnpauseMixer ()
 This method allows you to unpause all Audio Sources in the mixer (everything but Playlists).
 
static void StopMixer ()
 This method allows you to stop all Audio Sources in the mixer (everything but Playlists).
 
static void RestoreOriginalMixerVolumesAndPitches ()
 This method resets all Buses and Groups to their original volume and pitch
 
static void UnsubscribeFromAllVariations ()
 This method allows you to unsubscribe from all SoundFinished events in the entire MA hierarchy in your Scene.
 
static void StopEverything ()
 This method allows you to stop all Audio Sources in the mixer and Playlists as well.
 
static void PauseEverything ()
 This method allows you to pause all Audio Sources in the mixer and Playlists as well.
 
static void UnpauseEverything ()
 This method allows you to unpause all Audio Sources in the mixer and Playlists as well.
 
static void MuteEverything ()
 This method allows you to mute all Audio Sources in the mixer and Playlists as well.
 
static void UnmuteEverything ()
 This method allows you to unmute all Audio Sources in the mixer and Playlists as well.
 
static List< string > ListOfAudioClipsInGroupsEditTime ()
 This provides a list of of all audio clip names used in all Sound Groups, at edit time. More...
 
static void ChangeBusPitch (string busName, float pitch)
 This method allows you to change the pitch of all Variations in all Groups in a bus. More...
 
static void MuteBus (string busName)
 This method allows you to mute all Groups in a bus. More...
 
static void UnmuteBus (string busName, bool shouldCheckMuteStatus=true)
 This method allows you to unmute all Groups in a bus. More...
 
static void ToggleMuteBus (string busName)
 This will mute the bus if unmuted, and vice versa More...
 
static void PauseBus (string busName)
 This method allows you to pause all Audio Sources in a bus. More...
 
static void SoloBus (string busName)
 This method allows you to solo all Groups in a bus. More...
 
static void UnsoloBus (string busName, bool shouldCheckMuteStatus=true)
 This method allows you to unsolo all Groups in a bus. More...
 
static void StopBus (string busName)
 This method allows you to stop all Audio Sources in a bus. More...
 
static void UnpauseBus (string busName)
 This method allows you to unpause all paused Audio Sources in a bus. More...
 
static bool CreateBus (string busName, int? actorInstanceId, bool errorOnExisting=true, bool isTemporary=false)
 This method will create a new bus with the name you specify. More...
 
static void DeleteBusByName (string busName)
 This method will delete a bus by name. More...
 
static float GetBusVolume (MasterAudioGroup maGroup)
 This method will return the bus volume of a specified Sound Group, if any. If the Group is not in a bus, this will return 1. More...
 
static void FadeBusToVolume (string busName, float newVolume, float fadeTime, System.Action completionCallback=null, bool willStopAfterFade=false, bool willResetVolumeAfterFade=false)
 This method allows you to fade the volume of a bus over X seconds. More...
 
static void FadeOutOldBusVoices (string busName, float minimumPlayTime, float fadeTime)
 This method allows you to fade out voices on a Bus that have been playing for at least X seconds. More...
 
static void StopOldBusVoices (string busName, float minimumPlayTime)
 This method allows you to stop voices on a Bus that have been playing for at least X seconds. More...
 
static void GlideBusByPitch (string busName, float pitchAddition, float glideTime, System.Action completionCallback=null)
 This method allows you to glide the pitch of each playing Variation on each Sound Group assigned to a Bus over X seconds. More...
 
static void SetBusVolumeByName (string busName, float newVolume)
 This method will set the volume of a bus. More...
 
static GroupBus GrabBusByName (string busName)
 This method will return the settings of a bus. More...
 
static void PauseBusOfTransform (Transform sourceTrans, string busName)
 This method allows you to pause all sounds of a particular Bus triggered by or following a Transform More...
 
static void UnpauseBusOfTransform (Transform sourceTrans, string busName)
 This method allows you to unpause all sounds of a particular Bus triggered by or following a Transform More...
 
static void StopBusOfTransform (Transform sourceTrans, string busName)
 This method allows you to stop all sounds of a particular Bus triggered by or following a Transform More...
 
static void AddSoundGroupToDuckList (string sType, float riseVolumeStart, float duckedVolCut, float unduckTime, DuckMode duckMode=DuckMode.Music, bool enableDistanceDuckRation=false, bool isTemporary=false)
 This method will allow you to add a Sound Group to the list of sounds that cause music in the Playlist to duck. More...
 
static void RemoveSoundGroupFromDuckList (string sType)
 This method will allow you to remove a Sound Group from the list of sounds that cause music in the Playlist to duck. More...
 
static Playlist GrabPlaylist (string playlistName, bool logErrorIfNotFound=true)
 This method will find a Playlist by name and return it to you.
 
static void ChangePlaylistPitch (string playlistName, float pitch, string songName=null)
 This method will change the pitch of all clips in a Playlist, or a single song if you specify the song name. More...
 
static void MutePlaylist ()
 This method will allow you to mute your Playlist Controller. You should not use this if you have more than one Playlist Controller. Use the overloaded method instead, it takes a playlistControllerName parameter.
 
static void MutePlaylist (string playlistControllerName)
 This method will allow you to mute a Playlist Controller by name. More...
 
static void MuteAllPlaylists ()
 This method will allow you to mute all Playlist Controllers.
 
static void UnmutePlaylist ()
 This method will allow you to unmute your Playlist Controller. You should not use this if you have more than one Playlist Controller. Use the overloaded method instead, it takes a playlistControllerName parameter.
 
static void UnmutePlaylist (string playlistControllerName)
 This method will allow you to unmute a Playlist Controller by name. More...
 
static void UnmuteAllPlaylists ()
 This method will allow you to unmute all Playlist Controllers.
 
static void ToggleMutePlaylist ()
 This method will allow you to toggle mute on your Playlist Controller. You should not use this if you have more than one Playlist Controller. Use the overloaded method instead, it takes a playlistControllerName parameter.
 
static void ToggleMutePlaylist (string playlistControllerName)
 This method will allow you to toggle mute on a Playlist Controller by name. More...
 
static void ToggleMuteAllPlaylists ()
 This method will allow you to toggle mute on all Playlist Controllers.
 
static void PausePlaylist ()
 This method will allow you to pause your Playlist Controller. You should not use this if you have more than one Playlist Controller. Use the overloaded method instead, it takes a playlistControllerName parameter.
 
static void PausePlaylist (string playlistControllerName)
 This method will allow you to pause a Playlist Controller by name. More...
 
static void PauseAllPlaylists ()
 This method will allow you to pause all Playlist Controllers.
 
static void UnpausePlaylist ()
 This method will allow you to unpause a paused Playlist Controller. You should not use this if you have more than one Playlist Controller. Use the overloaded method instead, it takes a playlistControllerName parameter.
 
static void UnpausePlaylist (string playlistControllerName)
 This method will allow you to unpause a paused Playlist Controller by name. More...
 
static void UnpauseAllPlaylists ()
 This method will allow you to unpause all paused Playlist Controllers.
 
static void StopPlaylist ()
 This method will stop a Playlist Controller. You should not use this if you have more than one Playlist Controller. Use the overloaded method instead, it takes a playlistControllerName parameter.
 
static void StopPlaylist (string playlistControllerName)
 This method will stop a Playlist Controller by name. More...
 
static void StopAllPlaylists ()
 This method will allow you to stop all Playlist Controllers.
 
static void TriggerNextPlaylistClip ()
 This method will advance the Playlist to the next clip in your Playlist Controller. You should not use this if you have more than one Playlist Controller. Use the overloaded method instead, it takes a playlistControllerName parameter.
 
static void TriggerNextPlaylistClip (string playlistControllerName)
 This method will advance the Playlist to the next clip in the Playlist Controller you name. More...
 
static void TriggerNextClipAllPlaylists ()
 This method will allow you to advance Playlists in all Playlist Controllers to the next clip in their Playlist.
 
static void TriggerRandomPlaylistClip ()
 This method will play a random clip in the current Playlist for your Playlist Controller. You should not use this if you have more than one Playlist Controller. Use the overloaded method instead, it takes a playlistControllerName parameter.
 
static void TriggerRandomPlaylistClip (string playlistControllerName)
 This method will play a random clip in the current Playlist for the Playlist Controller you name. More...
 
static void TriggerRandomClipAllPlaylists ()
 This method will allow you to play a random clip in all Playlist Controllers using their currenct Playlist
 
static void RestartPlaylist ()
 This method will restart the current Playlist in the Playlist Controller. You should not use this if you have more than one Playlist Controller. Use the overloaded method instead, it takes a playlistControllerName parameter.
 
static void RestartPlaylist (string playlistControllerName)
 This method will restart a Playlist in the Playlist Controller. More...
 
static void RestartAllPlaylists ()
 This method will allow you to restart all Playlists.
 
static void StartPlaylist (string playlistName)
 This method is used to start a Playlist whether it's already loaded and playing or not. More...
 
static void StartPlaylistOnClip (string playlistName, string clipName)
 This method is used to start a Playlist whether it's already loaded and playing or not, on a specific Clip. More...
 
static void StartPlaylist (string playlistControllerName, string playlistName, string clipName=null)
 This method is used to start a Playlist whether it's already loaded and playing or not. More...
 
static void StopLoopingAllCurrentSongs ()
 This method will stop looping the current song on all Playlist Controllers so the next can play when it's finished (if auto-advance is on).
 
static void StopLoopingCurrentSong ()
 This method will stop looping the current song so the next can play when it's finished (if auto-advance is on). Use this method when only one Playlist Controller exists.
 
static void StopLoopingCurrentSong (string playlistControllerName)
 This method will stop looping the current song so the next can play when it's finished (if auto-advance is on). Use this method when more than one Playlist Controller exists. More...
 
static void StopAllPlaylistsAfterCurrentSongs ()
 This method will stop the Playlist after the current song on all Playlist Controllers.
 
static void StopPlaylistAfterCurrentSong ()
 This method will stop the Playlist after the current song.
 
static void StopPlaylistAfterCurrentSong (string playlistControllerName)
 This method will stop the Playlist after the current song. Use this method when more than one Playlist Controller exists. More...
 
static void QueuePlaylistClip (string clipName)
 This method will play an Audio Clip by name that's in the current Playlist of your Playlist Controller. You should not use this if you have more than one Playlist Controller. Use the overloaded method instead, it takes a playlistControllerName parameter. This requires auto-advance to work. More...
 
static void QueuePlaylistClip (string playlistControllerName, string clipName)
 This method will play an Audio Clip by name that's in the current Playlist of the Playlist Controller you name, as soon as the currently playing song is over. Loop will be turned off on the current song. This requires auto-advance to work. More...
 
static bool TriggerPlaylistClip (string clipName)
 This method will play an Audio Clip by name that's in the current Playlist of your Playlist Controller. You should not use this if you have more than one Playlist Controller. Use the overloaded method instead, it takes a playlistControllerName parameter. More...
 
static bool TriggerPlaylistClip (string playlistControllerName, string clipName)
 This method will play an Audio Clip by name that's in the current Playlist of the Playlist Controller you name. More...
 
static void ChangePlaylistByName (string playlistName, bool playFirstClip=true)
 This method will change the current Playlist in the Playlist Controller to a Playlist whose name you specify. You should not use this if you have more than one Playlist Controller. Use the overloaded method instead, it takes a playlistControllerName parameter. More...
 
static void ChangePlaylistByName (string playlistControllerName, string playlistName, bool playFirstClip=true)
 This method will play an Audio Clip by name that's in the current Playlist of the Playlist Controller you name. More...
 
static void FadePlaylistToVolume (float targetVolume, float fadeTime)
 This method will fade the volume of the Playlist Controller over X seconds. You should not use this if you have more than one Playlist Controller. Use the overloaded method instead, it takes a playlistControllerName parameter. More...
 
static void FadePlaylistToVolume (string playlistControllerName, float targetVolume, float fadeTime)
 This method will fade the volume of the Playlist Controller whose name you specify over X seconds. More...
 
static void FadeAllPlaylistsToVolume (float targetVolume, float fadeTime)
 This method will allow you to fade all current Playlists used by Playlist Controllers to a target volume over X seconds.
 
static void CreatePlaylist (Playlist playlist, bool errorOnDuplicate)
 This method will allow you to add a Playlist via code. More...
 
static void DeletePlaylist (string playlistName)
 This method will allow you to delete a Playlist via code. More...
 
static void AddSongToPlaylist (string playlistName, AudioClip song, bool loopSong=false, float songPitch=1f, float songVolume=1f, string alias=null)
 This method will allow you to add a song to a Playlist by code. More...
 
static void AddSongToPlaylist (string playlistName, MusicSetting newSong)
 This method will allow you to add a song to a Playlist by code. More...
 
static void AudioListenerChanged (AudioListener listener)
 Call this method if you have disabled the Audio Listener and enabled a different one, so Ambient Sounds will continue to work. More...
 
static void FireCustomEventNextFrame (string customEventName, Transform eventOrigin)
 Will fire a Custom Event during the next few frames. This is used by DynamicSoundGroupCreators to fire an event when it's done creating its items, since the listeners in the new Scene won't have been registered yet. More...
 
static void AddCustomEventReceiver (ICustomEventReceiver receiver, Transform receiverTrans)
 This method is used by MasterAudio to keep track of enabled CustomEventReceivers automatically. This is called when then CustomEventReceiver prefab is enabled. More...
 
static void RemoveCustomEventReceiver (ICustomEventReceiver receiver)
 This method is used by MasterAudio to keep track of enabled CustomEventReceivers automatically. This is called when then CustomEventReceiver prefab is disabled. More...
 
static void CreateCustomEvent (string customEventName, CustomEventReceiveMode eventReceiveMode, float distanceThreshold, EventReceiveFilter receiveFilter, int filterModeQty, int? actorInstanceId, string categoryName="", bool isTemporary=false, bool errorOnDuplicate=true)
 This method is used to create a Custom Event at runtime. More...
 
static void DeleteCustomEvent (string customEventName)
 This method is used to delete a temporary Custom Event at runtime. More...
 
static CustomEvent GetCustomEventByName (string customEventName)
 This will find a Custom Event by name. More...
 
static void FireCustomEvent (string customEventName, Transform originObject, bool logDupe=true)
 Calling this method will fire a Custom Event at the originPoint position. All CustomEventReceivers with the named event specified will do whatever action is assigned to them. If there is a distance criteria applied to receivers, it will be applied. More...
 
static bool CustomEventExists (string customEventName)
 Calling this method will return whether or not the specified Custom Event exists. More...
 
static void CreateRealTimeParameter (string paramName, float initialValue, bool isExpanded, float minValue, float maxValue, bool isTemporary=false, bool errorOnDuplicate=true)
 This method is used by Dynamic Sound Group Creator and other Inspectors to create a Parameter Comment More...
 
static ParameterCommand CreateRealTimeParameterCommand (string commandName, string paramName, bool isExpanded, float minDisplayCurveX, float maxDisplayCurveX, bool isTemporary=false, bool errorOnDuplicate=true)
 This method is used by Dynamic Sound Group Creator and other Inspectors to create a Parameter Command More...
 
static void CreateParameterCommandElement (ParameterCommand cmd, string elementName, string variationName, bool isExpanded, bool showAdvanced, EventSounds.VariationType variationMode, string soundGroup, float volume, bool overridePitch, float pitch, float delaySound, float fadeInRangeStart, float fadeInRangeEnd, float fadeOutRangeStart, float fadeOutRangeEnd, SoundSpawnLocationMode soundSpawnLocationMode, bool showCurves, bool affectVolume, AnimationCurve volumeAnimationCurve, bool affectPitch, AnimationCurve pitchAnimationCurve, bool showFadeInOutFields, bool affectLowPassFilter, AnimationCurve lowPassAnimationCurve, bool affectHighPassFilter, AnimationCurve highPassAnimationCurve, float maxDisplayVolumeCurveY=1f, bool errorOnDuplicate=true)
 This method is used by Dynamic Sound Group Creator and other Inspectors to create a Parameter Command More...
 
static void UpdateRealTimeParameter (string parameterName, float value)
 Use this method to update the value of a Real Time Parameter More...
 
static void StopParameterCommandsByCommandName (string commandName)
 This will stop all executing Parameter Commands with the given name. More...
 
static void StopParameterCommandsOfTransform (string commandName, Transform originObject)
 This will stop all executing Parameter Commands with the given name from Actor originObject. More...
 
static void StopParameterCommandByInstanceId (Guid? instanceId)
 This will stop an executing Parameter Command if it's active More...
 
static ? Guid InvokeParameterCommand (string parameterCommandName, Transform originObject)
 This method will invoke a Parameter Command by name from the location of the Transform supplied. More...
 

Properties

static float PlaylistMasterVolume [get, set]
 This Property can read and set the Playlist Master Volume.
 
static bool LogSoundsEnabled [get, set]
 This gets or sets whether Logging is enabled in Master Audio
 
static bool LogOutOfVoices [get, set]
 This gets or sets whether Logging Out Of Voices scenarios are enabled in Master Audio
 
static bool MixerMuted [get, set]
 This gets or sets whether the entire Mixer is muted or not.
 
static bool PlaylistsMuted [get, set]
 This gets or sets whether the all Playlists are muted or not.
 
bool EnableMusicDucking [get, set]
 This gets or sets whether music ducking is enabled.
 
float MasterCrossFadeTime [get]
 This gets the cross-fade time for Playlists
 
static List< Playlist > MusicPlaylists [get]
 This property will return all the Playlists set up in the Master Audio game object.
 
static List< GroupBusGroupBuses [get]
 This returns of list of all Buses.
 
static List< string > RuntimeSoundGroupNames [get]
 This will get you the list of all Sound Group Names at runtime only.
 
static List< string > RuntimeBusNames [get]
 This will get you the list of all Bus Names at runtime only.
 
static MasterAudio SafeInstance [get]
 This property returns a reference to the Singleton instance of MasterAudio, but does not log anything to the console. This is used by PersistentAudioSettings script only.
 
static MasterAudio Instance [get, set]
 This property returns a reference to the Singleton instance of
 
static bool SoundsReady [get]
 This returns true if MasterAudio is initialized and ready to use, false otherwise.
 
static bool AppIsShuttingDown [get, set]
 This property is used to prevent bogus Unity errors while the editor is stopping play. You should never need to read or set
 
List< string > GroupNames [get]
 This will return a list of all the Sound Group names.
 
List< string > BusNames [get]
 This will return a list of all the Bus names, including the selectors for "type in" and "no bus".
 
List< string > PlaylistNames [get]
 This will return a list of all the Playlists, including the selectors for "type in" and "no bus".
 
List< string > PlaylistNamesOnly [get]
 This will return a list of all the Playlists, not including the selectors for "type in" and "no bus".
 
List< string > CustomEventNames [get]
 This will return a list of all the Custom Events you have defined, including the selectors for "type in" and "none".
 
List< string > CustomEventNamesOnly [get]
 This will return a list of all the Custom Events you have defined, not including the selectors for "type in" and "none".
 
List< string > ParameterNames [get]
 This will return a list of all the Parameters you have defined, including the selectors for "type in" and "none".
 
List< string > ParameterCommandNames [get]
 This will return a list of all the Parameter Commands you have defined, including the selectors for "type in" and "none".
 
static List< string > ParameterHardCodedNames [get]
 Only used internally, do not use this property
 
static List< string > ParameterCommandHardCodedNames [get]
 Only used internally, do not use this property
 
static float MasterVolumeLevel [get, set]
 This is the overall master volume level which can change the relative volume of all buses and Sound Groups - not Playlist Controller songs though, they have their own master volume.
 
static SystemLanguage DynamicLanguage [get, set]
 This gets or sets the "Dynamic Language" (needs to be set at runtime based on the user's selection) for use with localized Resource Files.
 

Detailed Description

This class contains the heart of the Master Audio API. There are also convenience methods here for Playlist Controllers, even though you can call those methods on the Playlist Controller itself as well.

Member Function Documentation

◆ AddCustomEventReceiver()

static void DarkTonic.MasterAudio.MasterAudio.AddCustomEventReceiver ( ICustomEventReceiver  receiver,
Transform  receiverTrans 
)
static

This method is used by MasterAudio to keep track of enabled CustomEventReceivers automatically. This is called when then CustomEventReceiver prefab is enabled.

Parameters
receiverThe receiver object interface.
receiverTransThe receiver object Transform.

◆ AddSongToPlaylist() [1/2]

static void DarkTonic.MasterAudio.MasterAudio.AddSongToPlaylist ( string  playlistName,
AudioClip  song,
bool  loopSong = false,
float  songPitch = 1f,
float  songVolume = 1f,
string  alias = null 
)
static

This method will allow you to add a song to a Playlist by code.

Parameters
playlistNameThe name of the Playlist to add the song to.
songThe Audio clip of the song.
loopSongOptional - whether or not to loop the song.
songPitchOptional - the pitch of the song.
songVolumeOptional - The volume of the song.
aliasOptional - The alias for the song.

◆ AddSongToPlaylist() [2/2]

static void DarkTonic.MasterAudio.MasterAudio.AddSongToPlaylist ( string  playlistName,
MusicSetting  newSong 
)
static

This method will allow you to add a song to a Playlist by code.

Parameters
playlistNameThe name of the Playlist to add the song to.
newSongThe fully populated MusicSetting object for the song.

◆ AddSoundGroupToDuckList()

static void DarkTonic.MasterAudio.MasterAudio.AddSoundGroupToDuckList ( string  sType,
float  riseVolumeStart,
float  duckedVolCut,
float  unduckTime,
DuckMode  duckMode = DuckMode.Music,
bool  enableDistanceDuckRation = false,
bool  isTemporary = false 
)
static

This method will allow you to add a Sound Group to the list of sounds that cause music in the Playlist to duck.

Parameters
sTypeThe name of the Sound Group.
riseVolumeStartPercentage of time length to start unducking.
duckedVolCutAmount of decimals to cut the original volume.
unduckTimeAmount of time to return music to original volume.
duckModeThis controls whether you're ducking music, Sound Groups or both.
enableDistanceDuckRationWhether to use the distance to calculate and decrease the duck volume.
isTemporaryUsed by DSGC to create temporary duck groups.

◆ AudioListenerChanged()

static void DarkTonic.MasterAudio.MasterAudio.AudioListenerChanged ( AudioListener  listener)
static

Call this method if you have disabled the Audio Listener and enabled a different one, so Ambient Sounds will continue to work.

Parameters
listener

◆ ChangeBusPitch()

static void DarkTonic.MasterAudio.MasterAudio.ChangeBusPitch ( string  busName,
float  pitch 
)
static

This method allows you to change the pitch of all Variations in all Groups in a bus.

Parameters
busNameThe name of the bus.
pitchThe new pitch to use.

◆ ChangePlaylistByName() [1/2]

static void DarkTonic.MasterAudio.MasterAudio.ChangePlaylistByName ( string  playlistControllerName,
string  playlistName,
bool  playFirstClip = true 
)
static

This method will play an Audio Clip by name that's in the current Playlist of the Playlist Controller you name.

Parameters
playlistControllerNameThe Playlist Controller name
playlistNameThe name of the new Playlist.
playFirstClipOptional - defaults to True. If you specify false, the first clip in the Playlist will not automatically play.

◆ ChangePlaylistByName() [2/2]

static void DarkTonic.MasterAudio.MasterAudio.ChangePlaylistByName ( string  playlistName,
bool  playFirstClip = true 
)
static

This method will change the current Playlist in the Playlist Controller to a Playlist whose name you specify. You should not use this if you have more than one Playlist Controller. Use the overloaded method instead, it takes a playlistControllerName parameter.

Parameters
playlistNameThe name of the new Playlist.
playFirstClipOptional - defaults to True. If you specify false, the first clip in the Playlist will not automatically play.

◆ ChangePlaylistPitch()

static void DarkTonic.MasterAudio.MasterAudio.ChangePlaylistPitch ( string  playlistName,
float  pitch,
string  songName = null 
)
static

This method will change the pitch of all clips in a Playlist, or a single song if you specify the song name.

Parameters
playlistNameThe name of the Playlist.
pitchThe pitch to change the songs to.
songName(Optional) the song name to change the pitch of. If not specified, all songs will be changed.

◆ ChangeVariationClip()

static void DarkTonic.MasterAudio.MasterAudio.ChangeVariationClip ( string  sType,
bool  changeAllVariations,
string  variationName,
AudioClip  clip 
)
static

This method will change the Audio Clip used by a variation into one you specify.

Parameters
sTypeThe name of the Sound Group.
changeAllVariationsWhether to change all variations in the Sound Group or just one.
variationNameUse this to specify a certain variation's name. Only that variation will be changes if you haven't passed changeAllVariations as true.
clipThe Audio Clip to replace the old one with.

◆ ChangeVariationClipFromResources()

static void DarkTonic.MasterAudio.MasterAudio.ChangeVariationClipFromResources ( string  sType,
bool  changeAllVariations,
string  variationName,
string  resourceFileName 
)
static

This method will change the Audio Clip used by a variation into one named from a Resource file.

Parameters
sTypeThe name of the Sound Group.
changeAllVariationsWhether to change all variations in the Sound Group or just one.
variationNameUse this to specify a certain variation's name. Only that variation will be changes if you haven't passed changeAllVariations as true.
resourceFileNameThe name of the file in the Resource.

◆ ChangeVariationPitch()

static void DarkTonic.MasterAudio.MasterAudio.ChangeVariationPitch ( string  sType,
bool  changeAllVariations,
string  variationName,
float  pitch 
)
static

This method will change the pitch of a variation or all variations in a Sound Group.

Parameters
sTypeThe name of the Sound Group.
changeAllVariationsWhether to change all variations in the Sound Group or just one.
variationNameUse this to specify a certain variation's name. Only that variation will be changes if you haven't passed changeAllVariations as true.
pitchThe new pitch of the variation.

◆ ChangeVariationVolume()

static void DarkTonic.MasterAudio.MasterAudio.ChangeVariationVolume ( string  sType,
bool  changeAllVariations,
string  variationName,
float  volume 
)
static

This method will change the volume of a variation or all variations in a Sound Group.

Parameters
sTypeThe name of the Sound Group.
changeAllVariationsWhether to change all variations in the Sound Group or just one.
variationNameUse this to specify a certain variation's name. Only that variation will be changes if you haven't passed changeAllVariations as true.
volumeThe new volume of the variation.

◆ CreateBus()

static bool DarkTonic.MasterAudio.MasterAudio.CreateBus ( string  busName,
int?  actorInstanceId,
bool  errorOnExisting = true,
bool  isTemporary = false 
)
static

This method will create a new bus with the name you specify.

Parameters
busNameThe name of the new bus.
actorInstanceIdThe actor instanceId of the creator. Used the track if another Dynamic Sound Group Creator is still active with the bus so we don't delete it yet.
errorOnExistingWhether to log an error if the bus already exists (same name).
isTemporaryUsed by DGSC to create temporary buses.

◆ CreateCustomEvent()

static void DarkTonic.MasterAudio.MasterAudio.CreateCustomEvent ( string  customEventName,
CustomEventReceiveMode  eventReceiveMode,
float  distanceThreshold,
EventReceiveFilter  receiveFilter,
int  filterModeQty,
int?  actorInstanceId,
string  categoryName = "",
bool  isTemporary = false,
bool  errorOnDuplicate = true 
)
static

This method is used to create a Custom Event at runtime.

Parameters
customEventNameThe name of the custom event.
eventReceiveModeThe receive mode of the event.
distanceThresholdThe min or max distance to transmit the event to (optional).
receiveFilterType to filter by (optional).
filterModeQtyThe number to limit the filter by (optional).
categoryNameThe category of the custom event.
actorInstanceIdThe actor instanceId of the creator. Used the track if another Dynamic Sound Group Creator is still active with the bus so we don't delete it yet.
isTemporaryWhether the category of the custom event is temporary or not.
errorOnDuplicateWhether or not to log an error if the event already exists.

◆ CreateGroupVariationFromClip()

static void DarkTonic.MasterAudio.MasterAudio.CreateGroupVariationFromClip ( string  sType,
AudioClip  clip,
string  variationName,
float  volume = 1f,
float  pitch = 1f 
)
static

This method will add the variation to a Sound Group during runtime.

Parameters
sTypeThe name of the Sound Group.
clipThe Audio Clip of the variation.
variationNameUse this to specify a the variation's name.
volumeUse this to specify a the variation's volume.
pitchUse this to specify a the variation's pitch.

◆ CreateParameterCommandElement()

static void DarkTonic.MasterAudio.MasterAudio.CreateParameterCommandElement ( ParameterCommand  cmd,
string  elementName,
string  variationName,
bool  isExpanded,
bool  showAdvanced,
EventSounds.VariationType  variationMode,
string  soundGroup,
float  volume,
bool  overridePitch,
float  pitch,
float  delaySound,
float  fadeInRangeStart,
float  fadeInRangeEnd,
float  fadeOutRangeStart,
float  fadeOutRangeEnd,
SoundSpawnLocationMode  soundSpawnLocationMode,
bool  showCurves,
bool  affectVolume,
AnimationCurve  volumeAnimationCurve,
bool  affectPitch,
AnimationCurve  pitchAnimationCurve,
bool  showFadeInOutFields,
bool  affectLowPassFilter,
AnimationCurve  lowPassAnimationCurve,
bool  affectHighPassFilter,
AnimationCurve  highPassAnimationCurve,
float  maxDisplayVolumeCurveY = 1f,
bool  errorOnDuplicate = true 
)
static

This method is used by Dynamic Sound Group Creator and other Inspectors to create a Parameter Command

Parameters
cmd
elementName
variationName
isExpanded
showAdvanced
variationMode
soundGroup
volume
overridePitch
pitch
delaySound
fadeInRangeStart
fadeInRangeEnd
fadeOutRangeStart
fadeOutRangeEnd
soundSpawnLocationMode
affectVolume
volumeAnimationCurve
affectPitch
pitchAnimationCurve
showFadeInOutFields
maxDisplayVolumeCurveY
errorOnDuplicate


◆ CreatePlaylist()

static void DarkTonic.MasterAudio.MasterAudio.CreatePlaylist ( Playlist  playlist,
bool  errorOnDuplicate 
)
static

This method will allow you to add a Playlist via code.

Parameters
playlistThe playlist with all settings included
errorOnDuplicateWhether or not to log an error if the Playlist already exists (same name).

◆ CreateRealTimeParameter()

static void DarkTonic.MasterAudio.MasterAudio.CreateRealTimeParameter ( string  paramName,
float  initialValue,
bool  isExpanded,
float  minValue,
float  maxValue,
bool  isTemporary = false,
bool  errorOnDuplicate = true 
)
static

This method is used by Dynamic Sound Group Creator and other Inspectors to create a Parameter Comment

Parameters
paramName
initialValue
isExpanded
minValue
maxValue
isTemporarytrue if created by DynamicSoundGroupCreator
errorOnDuplicate

◆ CreateRealTimeParameterCommand()

static ParameterCommand DarkTonic.MasterAudio.MasterAudio.CreateRealTimeParameterCommand ( string  commandName,
string  paramName,
bool  isExpanded,
float  minDisplayCurveX,
float  maxDisplayCurveX,
bool  isTemporary = false,
bool  errorOnDuplicate = true 
)
static

This method is used by Dynamic Sound Group Creator and other Inspectors to create a Parameter Command

Parameters
commandName
isExpanded
isTemporarytrue if created by DynamicSoundGroupCreator
errorOnDuplicate
Returns

◆ CreateSoundGroup()

static Transform DarkTonic.MasterAudio.MasterAudio.CreateSoundGroup ( DynamicSoundGroup  aGroup,
int?  creatorInstanceId,
bool  errorOnExisting = true 
)
static

This method will create a new Sound Group from the Audio Clips you pass in.

Parameters
aGroupThe object containing all variations and group info.
creatorInstanceIdThe InstanceId of the Game Object creating the Sound Group.
errorOnExistingWhether to log an error if the Group already exists (same name).
Returns
Whether or not the Sound Group was created.

◆ CustomEventExists()

static bool DarkTonic.MasterAudio.MasterAudio.CustomEventExists ( string  customEventName)
static

Calling this method will return whether or not the specified Custom Event exists.

Parameters
customEventNameThe name of the custom event.

◆ DeleteBusByName()

static void DarkTonic.MasterAudio.MasterAudio.DeleteBusByName ( string  busName)
static

This method will delete a bus by name.

Parameters
busNameThe name of the bus to delete.

◆ DeleteCustomEvent()

static void DarkTonic.MasterAudio.MasterAudio.DeleteCustomEvent ( string  customEventName)
static

This method is used to delete a temporary Custom Event at runtime.

Parameters
customEventNameThe name of the custom event.

◆ DeleteGroupVariation()

static void DarkTonic.MasterAudio.MasterAudio.DeleteGroupVariation ( string  sType,
string  variationName 
)
static

This method will delete a variation from a Sound Group during runtime.

Parameters
sType
variationName

◆ DeletePlaylist()

static void DarkTonic.MasterAudio.MasterAudio.DeletePlaylist ( string  playlistName)
static

This method will allow you to delete a Playlist via code.

Parameters
playlistNameThe playlist name

◆ DeleteSoundGroup()

static void DarkTonic.MasterAudio.MasterAudio.DeleteSoundGroup ( string  sType)
static

This method will delete a Sound Group, and all variations from the current Scene's Master Audio object.

Parameters
sTypeThe name of the Sound Group.

◆ FadeBusToVolume()

static void DarkTonic.MasterAudio.MasterAudio.FadeBusToVolume ( string  busName,
float  newVolume,
float  fadeTime,
System.Action  completionCallback = null,
bool  willStopAfterFade = false,
bool  willResetVolumeAfterFade = false 
)
static

This method allows you to fade the volume of a bus over X seconds.

Parameters
busNameThe name of the bus to fade.
newVolumeThe target volume of the bus.
fadeTimeThe amount of time the fade will take.
completionCallback(Optional) - a method to execute when the fade has completed.
willStopAfterFade(Optional) - specify true here if you want the bus to stop after the fade is complete.
willResetVolumeAfterFade(Optional) - specify true here if you want the bus volume to be restored to its pre-fade volume after the fade is complete. This has no effect on a fade of less than .1 second.

◆ FadeOutAllOfSound()

static void DarkTonic.MasterAudio.MasterAudio.FadeOutAllOfSound ( string  sType,
float  fadeTime 
)
static

This method allows you to fade out all sounds in a specified Sound Group for X seconds. This uses each Variation's fade command. If you want to Fade a Sound Group with the Group volume, use FadeSoundGroupToVolume

Parameters
sTypeThe name of the Sound Group.
fadeTimeThe amount of seconds the fading will take.

◆ FadeOutAllSoundsOfTransform()

static void DarkTonic.MasterAudio.MasterAudio.FadeOutAllSoundsOfTransform ( Transform  sourceTrans,
float  fadeTime 
)
static

This method allows you to fade out all sounds triggered by or following a Transform for X seconds.

Parameters
sourceTransThe Transform the sound was triggered to follow or use the position of.
fadeTimeThe amount of seconds the fading will take.

◆ FadeOutOldBusVoices()

static void DarkTonic.MasterAudio.MasterAudio.FadeOutOldBusVoices ( string  busName,
float  minimumPlayTime,
float  fadeTime 
)
static

This method allows you to fade out voices on a Bus that have been playing for at least X seconds.

Parameters
busNameThe name of the bus to fade.
minimumPlayTimeThe minimum time that each Variation must have been playing to be faded.
fadeTimeThe duration of the fade to perform.

◆ FadeOutOldSoundGroupVoices()

static void DarkTonic.MasterAudio.MasterAudio.FadeOutOldSoundGroupVoices ( string  sType,
float  minimumPlayTime,
float  fadeTime 
)
static

This method allows you to fade out voices on a Sound Group that have been playing for at least X seconds.

Parameters
sTypeThe name of the Sound Group to fade.
minimumPlayTimeThe minimum time that each Variation must have been playing to be faded.
fadeTimeThe duration of the fade to perform.

◆ FadeOutSoundGroupOfTransform()

static void DarkTonic.MasterAudio.MasterAudio.FadeOutSoundGroupOfTransform ( Transform  sourceTrans,
string  sType,
float  fadeTime 
)
static

This method allows you to fade out all sounds of a particular Sound Group triggered by or following a Transform for X seconds.

Parameters
sourceTransThe Transform the sound was triggered to follow or use the position of.
sTypeThe name of the Sound Group.
fadeTimeThe amount of seconds the fading will take.

◆ FadePlaylistToVolume() [1/2]

static void DarkTonic.MasterAudio.MasterAudio.FadePlaylistToVolume ( float  targetVolume,
float  fadeTime 
)
static

This method will fade the volume of the Playlist Controller over X seconds. You should not use this if you have more than one Playlist Controller. Use the overloaded method instead, it takes a playlistControllerName parameter.

Parameters
targetVolumeThe target volume of the Playlist.
fadeTimeThe time to fade completely to the target volume.

◆ FadePlaylistToVolume() [2/2]

static void DarkTonic.MasterAudio.MasterAudio.FadePlaylistToVolume ( string  playlistControllerName,
float  targetVolume,
float  fadeTime 
)
static

This method will fade the volume of the Playlist Controller whose name you specify over X seconds.

Parameters
playlistControllerNameThe name of the Playlist Controller.
targetVolumeThe target volume of the Playlist.
fadeTimeThe time to fade completely to the target volume.

◆ FadeSoundGroupOfTransformToVolume()

static void DarkTonic.MasterAudio.MasterAudio.FadeSoundGroupOfTransformToVolume ( Transform  sourceTrans,
string  sType,
float  fadeTime,
float  targetVolume 
)
static

This method allows you to fade a certain Sound Group triggered by or following a Transform to a target volume over a period of time.

Parameters
sourceTransThe Transform the sound was triggered to follow or use the position of.
sTypeThe name of the Sound Group.
fadeTimeThe amount of seconds the fading will take.
targetVolumeThe end volume of the fade.

◆ FadeSoundGroupToVolume()

static void DarkTonic.MasterAudio.MasterAudio.FadeSoundGroupToVolume ( string  sType,
float  newVolume,
float  fadeTime,
System.Action  completionCallback = null,
bool  willStopAfterFade = false,
bool  willResetVolumeAfterFade = false 
)
static

This method allows you to fade the volume of a Sound Group over X seconds.

Parameters
sTypeThe name of the Sound Group to fade.
newVolumeThe target volume of the Sound Group.
fadeTimeThe amount of time the fade will take.
completionCallback(Optional) - a method to execute when the fade has completed.
willStopAfterFade(Optional) - specify true here if you want the Sound Group to stop after the fade is complete.
willResetVolumeAfterFade(Optional) - specify true here if you want the Sound Group's volume to be restored to its pre-fade volume after the fade is complete. This has no effect on a fade of less than .1 second.

◆ FireCustomEvent()

static void DarkTonic.MasterAudio.MasterAudio.FireCustomEvent ( string  customEventName,
Transform  originObject,
bool  logDupe = true 
)
static

Calling this method will fire a Custom Event at the originPoint position. All CustomEventReceivers with the named event specified will do whatever action is assigned to them. If there is a distance criteria applied to receivers, it will be applied.

Parameters
customEventNameThe name of the custom event.
originObjectThe Transform origin of the event.
logDupeWhether or not to log an error with duplicate event firing.

◆ FireCustomEventNextFrame()

static void DarkTonic.MasterAudio.MasterAudio.FireCustomEventNextFrame ( string  customEventName,
Transform  eventOrigin 
)
static

Will fire a Custom Event during the next few frames. This is used by DynamicSoundGroupCreators to fire an event when it's done creating its items, since the listeners in the new Scene won't have been registered yet.

Parameters
customEventName
eventOrigin

◆ GetAllPlayingVariations()

static List< SoundGroupVariation > DarkTonic.MasterAudio.MasterAudio.GetAllPlayingVariations ( )
static

Returns a list of all Variation scripts that are currently playing a sound.

Returns
List of SoundGroupVariation

◆ GetAllPlayingVariationsInBus()

static List< SoundGroupVariation > DarkTonic.MasterAudio.MasterAudio.GetAllPlayingVariationsInBus ( string  busName)
static

Returns a list of all Variation scripts that are currently playing through a bus.

Parameters
busNameThe name of the bus to query.
Returns
List of SoundGroupVariation

◆ GetAllPlayingVariationsOfTransform()

static List< SoundGroupVariation > DarkTonic.MasterAudio.MasterAudio.GetAllPlayingVariationsOfTransform ( Transform  sourceTrans)
static

This will return a list of all playing Variations of a Transform

Parameters
sourceTransSource transform
Returns
List of SoundGroupVariation

◆ GetAllPlayingVariationsOfTransformList()

static List< SoundGroupVariation > DarkTonic.MasterAudio.MasterAudio.GetAllPlayingVariationsOfTransformList ( List< Transform >  sourceTransList)
static

This will return a list of all playing Variations of a list of Transforms

Parameters
sourceTransListSource transform list
Returns
List of SoundGroupVariation

◆ GetBusVolume()

static float DarkTonic.MasterAudio.MasterAudio.GetBusVolume ( MasterAudioGroup  maGroup)
static

This method will return the bus volume of a specified Sound Group, if any. If the Group is not in a bus, this will return 1.

Parameters
maGroupThe Sound Group object.
Returns
The volume of the bus.

◆ GetCustomEventByName()

static CustomEvent DarkTonic.MasterAudio.MasterAudio.GetCustomEventByName ( string  customEventName)
static

This will find a Custom Event by name.

Parameters
customEventName
Returns

◆ GetGroupInfo()

static AudioGroupInfo DarkTonic.MasterAudio.MasterAudio.GetGroupInfo ( string  sType)
static

This method will return the Audio Group Info settings for examination purposes. Use on during play in editor, not during edit.

Parameters
sTypeThe name of the Sound Group
Returns
an Audio Group Info object

◆ GetGroupVolume()

static float DarkTonic.MasterAudio.MasterAudio.GetGroupVolume ( string  sType)
static

This will return the volume of a Sound Group.

Parameters
sTypeThe name of the Sound Group
Returns
The volume of the Sound Group

◆ GetNextVariationForSoundGroup()

static AudioSource DarkTonic.MasterAudio.MasterAudio.GetNextVariationForSoundGroup ( string  sType)
static

This returns the AudioSource for the next Variation to be played. Only works for top-to-bottom Variation Sequence.

Parameters
sType
Returns
Audio Source

◆ GetVariationLength()

static float DarkTonic.MasterAudio.MasterAudio.GetVariationLength ( string  sType,
string  variationName 
)
static

This method will return the length in seconds of a Variation in a Sound Group. Note that it only works for Clip type, not Resource Files or Addressables.

Parameters
sTypeThe name of the Sound Group.
variationNameUse this to specify a certain variation's name. The first match will be used
Returns
The time length of the Variation, taking pitch into account. If it cannot find the Variation, it returns -1 and logs the reason to the console.

◆ GlideBusByPitch()

static void DarkTonic.MasterAudio.MasterAudio.GlideBusByPitch ( string  busName,
float  pitchAddition,
float  glideTime,
System.Action  completionCallback = null 
)
static

This method allows you to glide the pitch of each playing Variation on each Sound Group assigned to a Bus over X seconds.

Parameters
busNameThe name of the bus to fade.
pitchAdditionThe amount of pitch to add to each playing Variation on each Sound Group assigned to the Bus.
glideTimeThe amount of time the pitch glide will take.
completionCallback(Optional) - a method to execute when the glide has completed.

◆ GlideSoundGroupByPitch()

static void DarkTonic.MasterAudio.MasterAudio.GlideSoundGroupByPitch ( string  sType,
float  pitchAddition,
float  glideTime,
System.Action  completionCallback = null 
)
static

This method allows you to glide the pitch of each Variation of a Sound Group over X seconds by a specified amount.

Parameters
sTypeThe name of the Sound Group to glide pitch.
pitchAdditionThe amount of pitch to add to each Variation's pitch in the Sound Group.
glideTimeThe amount of time the pitch glide will take.
completionCallback(Optional) - a method to execute when the pitch glide has completed.

◆ GrabBusByName()

static GroupBus DarkTonic.MasterAudio.MasterAudio.GrabBusByName ( string  busName)
static

This method will return the settings of a bus.

Parameters
busNameThe bus name.
Returns
GroupBus object

◆ GrabGroup()

static MasterAudioGroup DarkTonic.MasterAudio.MasterAudio.GrabGroup ( string  sType,
bool  logIfMissing = true 
)
static

This method will return the Sound Group settings for examination purposes.

Parameters
sTypeThe name of the Sound Group
logIfMissingWhether to log to the Console if Group cannot be found.
Returns
A MasterAudioGroup object

◆ InvokeParameterCommand()

static ? Guid DarkTonic.MasterAudio.MasterAudio.InvokeParameterCommand ( string  parameterCommandName,
Transform  originObject 
)
static

This method will invoke a Parameter Command by name from the location of the Transform supplied.

Parameters
parameterCommandNameParameter Command to fire
originObjectThe actor making the sounds

◆ IsSoundGroupPlaying()

static bool DarkTonic.MasterAudio.MasterAudio.IsSoundGroupPlaying ( string  sType)
static

Returns true or false, telling you true if a Sound Group is playing any voices.

Returns
true or false

◆ IsTransformPlayingSoundGroup()

static bool DarkTonic.MasterAudio.MasterAudio.IsTransformPlayingSoundGroup ( string  sType,
Transform  sourceTrans 
)
static

Will return whether the Sound Group you specify is played by a Transform you pass in.

Parameters
sTypeSound Group name
sourceTransThe Transform in question
Returns
boolean

◆ ListOfAudioClipsInGroupsEditTime()

static List< string > DarkTonic.MasterAudio.MasterAudio.ListOfAudioClipsInGroupsEditTime ( )
static

This provides a list of of all audio clip names used in all Sound Groups, at edit time.

Returns

◆ MuteBus()

static void DarkTonic.MasterAudio.MasterAudio.MuteBus ( string  busName)
static

This method allows you to mute all Groups in a bus.

Parameters
busNameThe name of the bus to mute.

◆ MuteGroup()

static void DarkTonic.MasterAudio.MasterAudio.MuteGroup ( string  sType,
bool  shouldCheckMuteStatus = true 
)
static

This method will mute all variations in a Sound Group.

Parameters
sTypeThe name of the Sound Group
shouldCheckMuteStatusWhether or not we should immediately go and silence other non-soloed Groups after soloing this one.

◆ MutePlaylist()

static void DarkTonic.MasterAudio.MasterAudio.MutePlaylist ( string  playlistControllerName)
static

This method will allow you to mute a Playlist Controller by name.

Parameters
playlistControllerNameThe name of the Playlist Controller.

◆ PauseAllSoundsOfTransform()

static void DarkTonic.MasterAudio.MasterAudio.PauseAllSoundsOfTransform ( Transform  sourceTrans)
static

This method allows you to pause all sounds triggered by or following a Transform.

Parameters
sourceTransThe Transform the sound was triggered to follow or use the position of.

◆ PauseBus()

static void DarkTonic.MasterAudio.MasterAudio.PauseBus ( string  busName)
static

This method allows you to pause all Audio Sources in a bus.

Parameters
busNameThe name of the bus to pause.

◆ PauseBusOfTransform()

static void DarkTonic.MasterAudio.MasterAudio.PauseBusOfTransform ( Transform  sourceTrans,
string  busName 
)
static

This method allows you to pause all sounds of a particular Bus triggered by or following a Transform

Parameters
sourceTransThe Transform the sound was triggered to follow or use the position of.
busNameThe name of the Bus.

◆ PausePlaylist()

static void DarkTonic.MasterAudio.MasterAudio.PausePlaylist ( string  playlistControllerName)
static

This method will allow you to pause a Playlist Controller by name.

Parameters
playlistControllerNameThe name of the Playlist Controller.

◆ PauseSoundGroup()

static void DarkTonic.MasterAudio.MasterAudio.PauseSoundGroup ( string  sType)
static

This method allows you to pause all Audio Sources in a Sound Group.

Parameters
sTypeThe name of the Sound Group to pause.

◆ PauseSoundGroupOfTransform()

static void DarkTonic.MasterAudio.MasterAudio.PauseSoundGroupOfTransform ( Transform  sourceTrans,
string  sType 
)
static

This method allows you to pause all sounds of a particular Sound Group triggered by or following a Transform.

Parameters
sourceTransThe Transform the sound was triggered to follow or use the position of.
sTypeThe name of the Sound Group to stop.

◆ PlaySound()

static PlaySoundResult DarkTonic.MasterAudio.MasterAudio.PlaySound ( string  sType,
float  volumePercentage = 1f,
float?  pitch = null,
float  delaySoundTime = 0f,
string  variationName = null,
double?  timeToSchedulePlay = null,
bool  isChaining = false,
bool  isSingleSubscribedPlay = false 
)
static

This method allows you to play a sound in a Sound Group in the location of the Master Audio prefab. Returns a PlaySoundResult object.

Parameters
sTypeThe name of the Sound Group to trigger a sound from.
volumePercentageOptional - used if you want to play the sound at a reduced volume (between 0 and 1).
pitchOptional - used if you want to play the sound at a specific pitch. If you do, it will override the pich and random pitch in the variation.
delaySoundTimeOptional - used if you want to play the sound X seconds from now instead of immediately.
variationNameOptional - used if you want to play a specific variation (or Clip id) by name. Otherwise a random variation is played.
timeToSchedulePlayOptional - used to pass in the DSP time to play the sound. Normally do not use this, use the delaySoundTime param instead.
isChainingDon't ever specify this - used to control number of loops for Chained Loop Groups. MasterAudio will pass this parameter when it needs it. Never specify this param.
isSingleSubscribedPlayDon't ever specify this - MasterAudio will pass this parameter when it needs it. Never specify this param.
Returns
PlaySoundResult - this object can be used to read if the sound played or not and also gives access to the Variation object that was used.

◆ PlaySound3DAtTransform()

static PlaySoundResult DarkTonic.MasterAudio.MasterAudio.PlaySound3DAtTransform ( string  sType,
Transform  sourceTrans,
float  volumePercentage = 1f,
float?  pitch = null,
float  delaySoundTime = 0f,
string  variationName = null,
double?  timeToSchedulePlay = null,
bool  isChaining = false,
bool  isSingleSubscribedPlay = false 
)
static

This method allows you to play a sound in a Sound Group from a specific position - the position of a Transform you pass in.

Parameters
sTypeThe name of the Sound Group to trigger a sound from.
sourceTransThe Transform whose position you want the sound to eminate from.
volumePercentageOptional - used if you want to play the sound at a reduced volume (between 0 and 1).
pitchOptional - used if you want to play the sound at a specific pitch. If you do, it will override the pich and random pitch in the variation.
delaySoundTimeOptional - used if you want to play the sound X seconds from now instead of immediately.
variationNameOptional - used if you want to play a specific variation (or Clip id) by name. Otherwise a random variation is played.
timeToSchedulePlayOptional - used to pass in the DSP time to play the sound. Normally do not use this, use the delaySoundTime param instead.
isChainingDon't ever specify this - used to control number of loops for Chained Loop Groups. MasterAudio will pass this parameter when it needs it. Never specify this param.
isSingleSubscribedPlayDon't ever specify this - MasterAudio will pass this parameter when it needs it. Never specify this param.
Returns
PlaySoundResult - this object can be used to read if the sound played or not and also gives access to the Variation object that was used.

◆ PlaySound3DAtTransformAndForget()

static bool DarkTonic.MasterAudio.MasterAudio.PlaySound3DAtTransformAndForget ( string  sType,
Transform  sourceTrans,
float  volumePercentage = 1f,
float?  pitch = null,
float  delaySoundTime = 0f,
string  variationName = null,
double?  timeToSchedulePlay = null,
bool  isChaining = false 
)
static

This method allows you to play a sound in a Sound Group from a specific position - the position of a Transform you pass in. Returns bool indicating success (played) or not.

Parameters
sTypeThe name of the Sound Group to trigger a sound from.
sourceTransThe Transform whose position you want the sound to eminate from.
volumePercentageOptional - used if you want to play the sound at a reduced volume (between 0 and 1).
pitchOptional - used if you want to play the sound at a specific pitch. If you do, it will override the pich and random pitch in the variation.
delaySoundTimeOptional - used if you want to play the sound X seconds from now instead of immediately.
variationNameOptional - used if you want to play a specific variation (or Clip id) by name. Otherwise a random variation is played.
timeToSchedulePlayOptional - used to pass in the DSP time to play the sound. Normally do not use this, use the delaySoundTime param instead.
isChainingDon't ever specify this - used to control number of loops for Chained Loop Groups. MasterAudio will pass this parameter when it needs it. Never specify this param.
Returns
boolean- true indicating that the sound was either played or scheduled, false otherwise.

◆ PlaySound3DAtTransformAndWaitUntilFinished()

static IEnumerator DarkTonic.MasterAudio.MasterAudio.PlaySound3DAtTransformAndWaitUntilFinished ( string  sType,
Transform  sourceTrans,
float  volumePercentage = 1f,
float?  pitch = null,
float  delaySoundTime = 0f,
string  variationName = null,
double?  timeToSchedulePlay = null,
System.Action  completedAction = null 
)
static

This method allows you to play a sound in a Sound Group from a specific position - a Transform you pass in. This method will not return until the sound is finished (or cannot play) to continue execution. You need to call this with StartCoroutine. The sound will not be played looped, since that could cause a Coroutine that would never end.

Parameters
sTypeThe name of the Sound Group to trigger a sound from.
sourceTransThe Transform whose position you want the sound to eminate from. Pass null if you want to play the sound 2D.
volumePercentageOptional - used if you want to play the sound at a reduced volume (between 0 and 1).
pitchOptional - used if you want to play the sound at a specific pitch. If you do, it will override the pich and random pitch in the variation.
delaySoundTimeOptional - used if you want to play the sound X seconds from now instead of immediately.
variationNameOptional - used if you want to play a specific variation (or Clip id) by name. Otherwise a random variation is played.
timeToSchedulePlayOptional - used to pass in the DSP time to play the sound. Normally do not use this, use the delaySoundTime param instead.
completedActionOptional - Code to execute when the sound is finished.

◆ PlaySound3DAtVector3()

static PlaySoundResult DarkTonic.MasterAudio.MasterAudio.PlaySound3DAtVector3 ( string  sType,
Vector3  sourcePosition,
float  volumePercentage = 1f,
float?  pitch = null,
float  delaySoundTime = 0f,
string  variationName = null,
double?  timeToSchedulePlay = null 
)
static

This method allows you to play a sound in a Sound Group from a specific Vector3 position. Returns a PlaySoundResult object.

Parameters
sTypeThe name of the Sound Group to trigger a sound from.
sourcePositionThe position you want the sound to eminate from. Required.
volumePercentageOptional - used if you want to play the sound at a reduced volume (between 0 and 1).
pitchOptional - used if you want to play the sound at a specific pitch. If you do, it will override the pich and random pitch in the variation.
delaySoundTimeOptional - used if you want to play the sound X seconds from now instead of immediately.
variationNameOptional - used if you want to play a specific variation (or Clip id) by name. Otherwise a random variation is played.
timeToSchedulePlayOptional - used to pass in the DSP time to play the sound. Normally do not use this, use the delaySoundTime param instead.
Returns
PlaySoundResult - this object can be used to read if the sound played or not and also gives access to the Variation object that was used.

◆ PlaySound3DAtVector3AndForget()

static bool DarkTonic.MasterAudio.MasterAudio.PlaySound3DAtVector3AndForget ( string  sType,
Vector3  sourcePosition,
float  volumePercentage = 1f,
float?  pitch = null,
float  delaySoundTime = 0f,
string  variationName = null,
double?  timeToSchedulePlay = null 
)
static

This method allows you to play a sound in a Sound Group from a specific Vector 3 position. Returns bool indicating success (played) or not.

Parameters
sTypeThe name of the Sound Group to trigger a sound from.
sourcePositionThe position you want the sound to eminate from. Required.
volumePercentageOptional - used if you want to play the sound at a reduced volume (between 0 and 1).
pitchOptional - used if you want to play the sound at a specific pitch. If you do, it will override the pich and random pitch in the variation.
delaySoundTimeOptional - used if you want to play the sound X seconds from now instead of immediately.
variationNameOptional - used if you want to play a specific variation (or Clip id) by name. Otherwise a random variation is played.
timeToSchedulePlayOptional - used to pass in the DSP time to play the sound. Normally do not use this, use the delaySoundTime param instead.
Returns
boolean- true indicating that the sound was either played or scheduled, false otherwise.

◆ PlaySound3DFollowTransform()

static PlaySoundResult DarkTonic.MasterAudio.MasterAudio.PlaySound3DFollowTransform ( string  sType,
Transform  sourceTrans,
float  volumePercentage = 1f,
float?  pitch = null,
float  delaySoundTime = 0f,
string  variationName = null,
double?  timeToSchedulePlay = null,
bool  isChaining = false,
bool  isSingleSubscribedPlay = false 
)
static

This method allows you to play a sound in a Sound Group from a specific position - a Transform you pass in, and it will follow the Transform if it moves. Returns a PlaySoundResult.

Parameters
sTypeThe name of the Sound Group to trigger a sound from.
sourceTransThe Transform whose position you want the sound to eminate from.
volumePercentageOptional - used if you want to play the sound at a reduced volume (between 0 and 1).
pitchOptional - used if you want to play the sound at a specific pitch. If you do, it will override the pich and random pitch in the variation.
delaySoundTimeOptional - used if you want to play the sound X seconds from now instead of immediately.
variationNameOptional - used if you want to play a specific variation (or Clip id) by name. Otherwise a random variation is played.
timeToSchedulePlayOptional - used to pass in the DSP time to play the sound. Normally do not use this, use the delaySoundTime param instead.
isChainingDon't ever specify this - used to control number of loops for Chained Loop Groups. MasterAudio will pass this parameter when it needs it. Never specify this param.
isSingleSubscribedPlayDon't ever specify this - MasterAudio will pass this parameter when it needs it. Never specify this param.
Returns
PlaySoundResult - this object can be used to read if the sound played or not and also gives access to the Variation object that was used.

◆ PlaySound3DFollowTransformAndForget()

static bool DarkTonic.MasterAudio.MasterAudio.PlaySound3DFollowTransformAndForget ( string  sType,
Transform  sourceTrans,
float  volumePercentage = 1f,
float?  pitch = null,
float  delaySoundTime = 0f,
string  variationName = null,
double?  timeToSchedulePlay = null,
bool  isChaining = false 
)
static

This method allows you to play a sound in a Sound Group from a specific position - a Transform you pass in. Returns bool indicating success (played) or not.

Parameters
sTypeThe name of the Sound Group to trigger a sound from.
sourceTransThe Transform whose position you want the sound to eminate from.
volumePercentageOptional - used if you want to play the sound at a reduced volume (between 0 and 1).
pitchOptional - used if you want to play the sound at a specific pitch. If you do, it will override the pich and random pitch in the variation.
delaySoundTimeOptional - used if you want to play the sound X seconds from now instead of immediately.
variationNameOptional - used if you want to play a specific variation (or Clip id) by name. Otherwise a random variation is played.
timeToSchedulePlayOptional - used to pass in the DSP time to play the sound. Normally do not use this, use the delaySoundTime param instead.
isChainingDon't ever specify this - used to control number of loops for Chained Loop Groups. MasterAudio will pass this parameter when it needs it. Never specify this param.
Returns
boolean- true indicating that the sound was either played or scheduled, false otherwise.

◆ PlaySound3DFollowTransformAndWaitUntilFinished()

static IEnumerator DarkTonic.MasterAudio.MasterAudio.PlaySound3DFollowTransformAndWaitUntilFinished ( string  sType,
Transform  sourceTrans,
float  volumePercentage = 1f,
float?  pitch = null,
float  delaySoundTime = 0f,
string  variationName = null,
double?  timeToSchedulePlay = null,
System.Action  completedAction = null 
)
static

This method allows you to play a sound in a Sound Group from a specific position - a Transform you pass in, and it will follow the Transform if it moves. This method will not return until the sound is finished (or cannot play) to continue execution. You need to call this with StartCoroutine. The sound will not be played looped, since that could cause a Coroutine that would never end.

Parameters
sTypeThe name of the Sound Group to trigger a sound from.
sourceTransThe Transform whose position you want the sound to eminate from. Pass null if you want to play the sound 2D.
volumePercentageOptional - used if you want to play the sound at a reduced volume (between 0 and 1).
pitchOptional - used if you want to play the sound at a specific pitch. If you do, it will override the pich and random pitch in the variation.
delaySoundTimeOptional - used if you want to play the sound X seconds from now instead of immediately.
variationNameOptional - used if you want to play a specific variation (or Clip id) by name. Otherwise a random variation is played.
timeToSchedulePlayOptional - used to pass in the DSP time to play the sound. Normally do not use this, use the delaySoundTime param instead.
completedActionOptional - Code to execute when the sound is finished.

◆ PlaySoundAndForget()

static bool DarkTonic.MasterAudio.MasterAudio.PlaySoundAndForget ( string  sType,
float  volumePercentage = 1f,
float?  pitch = null,
float  delaySoundTime = 0f,
string  variationName = null,
double?  timeToSchedulePlay = null,
bool  isChaining = false 
)
static

This method allows you to play a sound in a Sound Group in the location of the Master Audio prefab. Returns bool indicating success (played) or not.

Parameters
sTypeThe name of the Sound Group to trigger a sound from.
volumePercentageOptional - used if you want to play the sound at a reduced volume (between 0 and 1).
pitchOptional - used if you want to play the sound at a specific pitch. If you do, it will override the pich and random pitch in the variation.
delaySoundTimeOptional - used if you want to play the sound X seconds from now instead of immediately.
variationNameOptional - used if you want to play a specific variation (or Clip id) by name. Otherwise a random variation is played.
timeToSchedulePlayOptional - used to pass in the DSP time to play the sound. Normally do not use this, use the delaySoundTime param instead.
isChainingDon't ever specify this - used to control number of loops for Chained Loop Groups. MasterAudio will pass this parameter when it needs it. Never specify this param.
Returns
boolean- true indicating that the sound was either played or scheduled, false otherwise.

◆ PlaySoundAndWaitUntilFinished()

static IEnumerator DarkTonic.MasterAudio.MasterAudio.PlaySoundAndWaitUntilFinished ( string  sType,
float  volumePercentage = 1f,
float?  pitch = null,
float  delaySoundTime = 0f,
string  variationName = null,
System.Action  completedAction = null 
)
static

This method allows you to play a sound in a Sound Group from the location of Master Audio. This method will not return until the sound is finished (or cannot play) to continue execution. You need to call this with StartCoroutine. The sound will not be played looped, since that could cause a Coroutine that would never end.

Parameters
sTypeThe name of the Sound Group to trigger a sound from.
volumePercentageOptional - used if you want to play the sound at a reduced volume (between 0 and 1).
pitchOptional - used if you want to play the sound at a specific pitch. If you do, it will override the pich and random pitch in the variation.
delaySoundTimeOptional - used if you want to play the sound X seconds from now instead of immediately.
variationNameOptional - used if you want to play a specific variation (or Clip id) by name. Otherwise a random variation is played.
completedActionOptional - Code to execute when the sound is finished.

◆ QueuePlaylistClip() [1/2]

static void DarkTonic.MasterAudio.MasterAudio.QueuePlaylistClip ( string  clipName)
static

This method will play an Audio Clip by name that's in the current Playlist of your Playlist Controller. You should not use this if you have more than one Playlist Controller. Use the overloaded method instead, it takes a playlistControllerName parameter. This requires auto-advance to work.

Parameters
clipNameThe name of the clip.

◆ QueuePlaylistClip() [2/2]

static void DarkTonic.MasterAudio.MasterAudio.QueuePlaylistClip ( string  playlistControllerName,
string  clipName 
)
static

This method will play an Audio Clip by name that's in the current Playlist of the Playlist Controller you name, as soon as the currently playing song is over. Loop will be turned off on the current song. This requires auto-advance to work.

Parameters
clipNameThe name of the clip.
playlistControllerNameThe name of the Playlist Controller.

◆ RefillSoundGroupPool()

static void DarkTonic.MasterAudio.MasterAudio.RefillSoundGroupPool ( string  sType)
static

This method allows you to refill the pool of the Variation sounds for a Sound Group. That way you don't have to wait for all remaining random (or top to bottom) sounds to be played before it refills.

Parameters
sTypeThe name of the Sound Group to refill the pool of.

◆ RemoveCustomEventReceiver()

static void DarkTonic.MasterAudio.MasterAudio.RemoveCustomEventReceiver ( ICustomEventReceiver  receiver)
static

This method is used by MasterAudio to keep track of enabled CustomEventReceivers automatically. This is called when then CustomEventReceiver prefab is disabled.

Parameters
receiverThe receiver object interface.

◆ RemoveSoundGroupFromDuckList()

static void DarkTonic.MasterAudio.MasterAudio.RemoveSoundGroupFromDuckList ( string  sType)
static

This method will allow you to remove a Sound Group from the list of sounds that cause music in the Playlist to duck.

Parameters
sTypeThe name of the Sound Group.

◆ RestartPlaylist()

static void DarkTonic.MasterAudio.MasterAudio.RestartPlaylist ( string  playlistControllerName)
static

This method will restart a Playlist in the Playlist Controller.

Parameters
playlistControllerNameThe Playlist Controller.

◆ RouteGroupToBus()

static void DarkTonic.MasterAudio.MasterAudio.RouteGroupToBus ( string  sType,
string  busName 
)
static

Change the bus of a Sound Group.

Parameters
sTypeSound Group name
busNameThe new bus name. Use null for "route to [No Bus]"

◆ SetBusVolumeByName()

static void DarkTonic.MasterAudio.MasterAudio.SetBusVolumeByName ( string  busName,
float  newVolume 
)
static

This method will set the volume of a bus.

Parameters
newVolumeThe volume to set the bus to.
busNameThe bus name.

◆ SetGroupVolume()

static void DarkTonic.MasterAudio.MasterAudio.SetGroupVolume ( string  sType,
float  volumeLevel 
)
static

This method will set the volume of a Sound Group.

Parameters
sTypeThe name of the Sound Group
volumeLevelThe new volume level.

◆ SoloBus()

static void DarkTonic.MasterAudio.MasterAudio.SoloBus ( string  busName)
static

This method allows you to solo all Groups in a bus.

Parameters
busNameThe name of the bus to solo.

◆ SoloGroup()

static void DarkTonic.MasterAudio.MasterAudio.SoloGroup ( string  sType,
bool  shouldCheckMuteStatus = true 
)
static

This method will solo a Sound Group. If anything is soloed, only soloed Sound Groups will be heard.

Parameters
sTypeThe name of the Sound Group
shouldCheckMuteStatusWhether or not we should immediately go and silence other non-soloed Groups after soloing this one.

◆ SoundGroupExists()

static bool DarkTonic.MasterAudio.MasterAudio.SoundGroupExists ( string  sType)
static

This method allows you to check if a Sound Group exists.

Parameters
sTypeThe name of the Sound Group to check.
Returns
Whether or not the Sound Group exists.

◆ StartPlaylist() [1/2]

static void DarkTonic.MasterAudio.MasterAudio.StartPlaylist ( string  playlistControllerName,
string  playlistName,
string  clipName = null 
)
static

This method is used to start a Playlist whether it's already loaded and playing or not.

Parameters
playlistControllerNameThe name of the Playlist Controller to use
playlistNameThe name of the Playlist to start
clipNameOptional - The name of the Clip to play

◆ StartPlaylist() [2/2]

static void DarkTonic.MasterAudio.MasterAudio.StartPlaylist ( string  playlistName)
static

This method is used to start a Playlist whether it's already loaded and playing or not.

Parameters
playlistNameThe name of the Playlist to start

◆ StartPlaylistOnClip()

static void DarkTonic.MasterAudio.MasterAudio.StartPlaylistOnClip ( string  playlistName,
string  clipName 
)
static

This method is used to start a Playlist whether it's already loaded and playing or not, on a specific Clip.

Parameters
playlistNameThe name of the Playlist to start
clipNameThe name of the Clip to play

◆ StopAllOfSound()

static void DarkTonic.MasterAudio.MasterAudio.StopAllOfSound ( string  sType)
static

This method allows you to abruptly stop all sounds in a specified Sound Group.

Parameters
sTypeThe name of the Sound Group.

◆ StopAllSoundsOfTransform()

static void DarkTonic.MasterAudio.MasterAudio.StopAllSoundsOfTransform ( Transform  sourceTrans)
static

This method allows you to abruptly stop all sounds triggered by or following a Transform.

Parameters
sourceTransThe Transform the sound was triggered to follow or use the position of.

◆ StopBus()

static void DarkTonic.MasterAudio.MasterAudio.StopBus ( string  busName)
static

This method allows you to stop all Audio Sources in a bus.

Parameters
busNameThe name of the bus to stop.

◆ StopBusOfTransform()

static void DarkTonic.MasterAudio.MasterAudio.StopBusOfTransform ( Transform  sourceTrans,
string  busName 
)
static

This method allows you to stop all sounds of a particular Bus triggered by or following a Transform

Parameters
sourceTransThe Transform the sound was triggered to follow or use the position of.
busNameThe name of the Bus.

◆ StopLoopingCurrentSong()

static void DarkTonic.MasterAudio.MasterAudio.StopLoopingCurrentSong ( string  playlistControllerName)
static

This method will stop looping the current song so the next can play when it's finished (if auto-advance is on). Use this method when more than one Playlist Controller exists.

Parameters
playlistControllerNameThe name of the Playlist Controller.

◆ StopOldBusVoices()

static void DarkTonic.MasterAudio.MasterAudio.StopOldBusVoices ( string  busName,
float  minimumPlayTime 
)
static

This method allows you to stop voices on a Bus that have been playing for at least X seconds.

Parameters
busNameThe name of the bus to fade.
minimumPlayTimeThe minimum time that each Variation must have been playing to be stopped.

◆ StopOldSoundGroupVoices()

static void DarkTonic.MasterAudio.MasterAudio.StopOldSoundGroupVoices ( string  sType,
float  minimumPlayTime 
)
static

This method allows you to stop voices on a Sound Group that have been playing for at least X seconds.

Parameters
sTypeThe name of the Sound Group to stop.
minimumPlayTimeThe minimum time that each Variation must have been playing to be stopped.

◆ StopParameterCommandByInstanceId()

static void DarkTonic.MasterAudio.MasterAudio.StopParameterCommandByInstanceId ( Guid?  instanceId)
static

This will stop an executing Parameter Command if it's active

Parameters
instanceId

◆ StopParameterCommandsByCommandName()

static void DarkTonic.MasterAudio.MasterAudio.StopParameterCommandsByCommandName ( string  commandName)
static

This will stop all executing Parameter Commands with the given name.

Parameters
commandNameCommand name

◆ StopParameterCommandsOfTransform()

static void DarkTonic.MasterAudio.MasterAudio.StopParameterCommandsOfTransform ( string  commandName,
Transform  originObject 
)
static

This will stop all executing Parameter Commands with the given name from Actor originObject.

Parameters
commandNameCommand name
originObjectActor that made the sounds

◆ StopPlaylist()

static void DarkTonic.MasterAudio.MasterAudio.StopPlaylist ( string  playlistControllerName)
static

This method will stop a Playlist Controller by name.

Parameters
playlistControllerNameThe name of the Playlist Controller.

◆ StopPlaylistAfterCurrentSong()

static void DarkTonic.MasterAudio.MasterAudio.StopPlaylistAfterCurrentSong ( string  playlistControllerName)
static

This method will stop the Playlist after the current song. Use this method when more than one Playlist Controller exists.

Parameters
playlistControllerNameThe name of the Playlist Controller.

◆ StopSoundGroupOfTransform()

static void DarkTonic.MasterAudio.MasterAudio.StopSoundGroupOfTransform ( Transform  sourceTrans,
string  sType 
)
static

This method allows you to abruptly stop all sounds of a particular Sound Group triggered by or following a Transform.

Parameters
sourceTransThe Transform the sound was triggered to follow or use the position of.
sTypeThe name of the Sound Group to stop.

◆ SubscribeToLastVariationPlayed()

static void DarkTonic.MasterAudio.MasterAudio.SubscribeToLastVariationPlayed ( string  sType,
System.Action  finishedCallback 
)
static

Use this method if you want to be notified when the last Variation in a Sound Group has finished playing (all have played).

Parameters
sTypeThe name of the Sound Group
finishedCallbackCode to execute when the last Variation finishes playing

◆ ToggleMuteBus()

static void DarkTonic.MasterAudio.MasterAudio.ToggleMuteBus ( string  busName)
static

This will mute the bus if unmuted, and vice versa

Parameters
busNameName of the bus to toggle mute of

◆ ToggleMutePlaylist()

static void DarkTonic.MasterAudio.MasterAudio.ToggleMutePlaylist ( string  playlistControllerName)
static

This method will allow you to toggle mute on a Playlist Controller by name.

Parameters
playlistControllerNameThe name of the Playlist Controller.

◆ TriggerNextPlaylistClip()

static void DarkTonic.MasterAudio.MasterAudio.TriggerNextPlaylistClip ( string  playlistControllerName)
static

This method will advance the Playlist to the next clip in the Playlist Controller you name.

Parameters
playlistControllerNameThe name of the Playlist Controller.

◆ TriggerPlaylistClip() [1/2]

static bool DarkTonic.MasterAudio.MasterAudio.TriggerPlaylistClip ( string  clipName)
static

This method will play an Audio Clip by name that's in the current Playlist of your Playlist Controller. You should not use this if you have more than one Playlist Controller. Use the overloaded method instead, it takes a playlistControllerName parameter.

Parameters
clipNameThe name of the clip.
Returns
bool - whether the song was played or not.

◆ TriggerPlaylistClip() [2/2]

static bool DarkTonic.MasterAudio.MasterAudio.TriggerPlaylistClip ( string  playlistControllerName,
string  clipName 
)
static

This method will play an Audio Clip by name that's in the current Playlist of the Playlist Controller you name.

Parameters
clipNameThe name of the clip.
playlistControllerNameThe name of the Playlist Controller.
Returns
bool - whether the song was played or not.

◆ TriggerRandomPlaylistClip()

static void DarkTonic.MasterAudio.MasterAudio.TriggerRandomPlaylistClip ( string  playlistControllerName)
static

This method will play a random clip in the current Playlist for the Playlist Controller you name.

Parameters
playlistControllerNameThe name of the Playlist Controller.

◆ UnmuteBus()

static void DarkTonic.MasterAudio.MasterAudio.UnmuteBus ( string  busName,
bool  shouldCheckMuteStatus = true 
)
static

This method allows you to unmute all Groups in a bus.

Parameters
busNameThe name of the bus to unmute.
shouldCheckMuteStatusWhether or not we should immediately go and silence other non-soloed Groups after soloing this one.

◆ UnmuteGroup()

static void DarkTonic.MasterAudio.MasterAudio.UnmuteGroup ( string  sType,
bool  shouldCheckMuteStatus = true 
)
static

This method will unmute all variations in a Sound Group

Parameters
sTypeThe name of the Sound Group
shouldCheckMuteStatusWhether or not we should immediately go and silence other non-soloed Groups after soloing this one.

◆ UnmutePlaylist()

static void DarkTonic.MasterAudio.MasterAudio.UnmutePlaylist ( string  playlistControllerName)
static

This method will allow you to unmute a Playlist Controller by name.

Parameters
playlistControllerNameThe name of the Playlist Controller.

◆ UnpauseAllSoundsOfTransform()

static void DarkTonic.MasterAudio.MasterAudio.UnpauseAllSoundsOfTransform ( Transform  sourceTrans)
static

This method allows you to unpause all sounds triggered by or following a Transform.

Parameters
sourceTransThe Transform the sound was triggered to follow or use the position of.

◆ UnpauseBus()

static void DarkTonic.MasterAudio.MasterAudio.UnpauseBus ( string  busName)
static

This method allows you to unpause all paused Audio Sources in a bus.

Parameters
busNameThe name of the bus to unpause.

◆ UnpauseBusOfTransform()

static void DarkTonic.MasterAudio.MasterAudio.UnpauseBusOfTransform ( Transform  sourceTrans,
string  busName 
)
static

This method allows you to unpause all sounds of a particular Bus triggered by or following a Transform

Parameters
sourceTransThe Transform the sound was triggered to follow or use the position of.
busNameThe name of the Bus.

◆ UnpausePlaylist()

static void DarkTonic.MasterAudio.MasterAudio.UnpausePlaylist ( string  playlistControllerName)
static

This method will allow you to unpause a paused Playlist Controller by name.

Parameters
playlistControllerNameThe name of the Playlist Controller.

◆ UnpauseSoundGroup()

static void DarkTonic.MasterAudio.MasterAudio.UnpauseSoundGroup ( string  sType)
static

This method allows you to unpause all Audio Sources in a Sound Group.

Parameters
sTypeThe name of the Sound Group to unpause.

◆ UnpauseSoundGroupOfTransform()

static void DarkTonic.MasterAudio.MasterAudio.UnpauseSoundGroupOfTransform ( Transform  sourceTrans,
string  sType 
)
static

This method allows you to unpause all sounds of a particular Sound Group triggered by or following a Transform.

Parameters
sourceTransThe Transform the sound was triggered to follow or use the position of.
sTypeThe name of the Sound Group to stop.

◆ UnsoloBus()

static void DarkTonic.MasterAudio.MasterAudio.UnsoloBus ( string  busName,
bool  shouldCheckMuteStatus = true 
)
static

This method allows you to unsolo all Groups in a bus.

Parameters
busNameThe name of the bus to unsolo.
shouldCheckMuteStatusWhether or not we should immediately go and silence other non-soloed Groups after soloing this one.

◆ UnsoloGroup()

static void DarkTonic.MasterAudio.MasterAudio.UnsoloGroup ( string  sType,
bool  shouldCheckMuteStatus = true 
)
static

This method will unsolo a Sound Group.

Parameters
sTypeThe name of the Sound Group
shouldCheckMuteStatusWhether or not we should immediately go and silence other non-soloed Groups after soloing this one.

◆ UnsubscribeFromLastVariationPlayed()

static void DarkTonic.MasterAudio.MasterAudio.UnsubscribeFromLastVariationPlayed ( string  sType)
static

Use this method to cease notifications added by SubscribeToLastVariationPlayed.

Parameters
sTypeThe name of the Sound Group

◆ UpdateRealTimeParameter()

static void DarkTonic.MasterAudio.MasterAudio.UpdateRealTimeParameter ( string  parameterName,
float  value 
)
static

Use this method to update the value of a Real Time Parameter

Parameters
parameterNameThe name of the Parameter
valueNew value

◆ VoicesForGroup()

static int DarkTonic.MasterAudio.MasterAudio.VoicesForGroup ( string  sType)
static

Returns total number of Audio Sources for this Sound Group.

Parameters
sTypeName of the Sound Group
Returns

The documentation for this class was generated from the following file: