AudioController Members

Audio Toolkit

Collapse image Expand Image Copy image CopyHover image

The AudioController type exposes the following members.

Constructors

  Name Description
Public method AudioController
Initializes a new instance of the AudioController class

Methods

  Name Description
Public method Static member AddPlaylist
Adds a new playlist.
Public method Static member AddToCategory(AudioCategory, AudioItem)
Adds a custom audio item to a category.
Public method Static member AddToCategory(AudioCategory, AudioClip, String)
Creates an AudioItem with the name audioID containing a single subitem playing the specified custom AudioClip. This AudioItem is then added to the specified category.
Public method Static member ClearPlaylists
Clears all music playlist.
Public method Static member DetachAllAudios
Detaches all audio objects possibly parented to the specified game object.
Public method Static member EnableAmbienceSound
Enables the ambience sound.
Public method Static member EnableMusic
Enables the music.
Public method Static member EnqueueMusic
Enqueues an audio ID to the music playlist queue.
Public method Static member GetAudioItem
Returns the AudioItem with the given audioID.
Public method Static member GetAudioItemMaxDistance
Gets the audio item's max distance. (respects all proper default values and overwrites).
Public method Static member GetCategory
Gets a category.
Public method Static member GetCategoryVolume
Gets the category volume.
Public method Static member GetCurrentAmbienceSound
Gets the current ambience sound.
Public method Static member GetCurrentAudioListener
Gets the currently active Unity audio listener.
Public method Static member GetCurrentMusic
Gets the current music.
Public method Static member GetGlobalVolume
Gets the global volume.
Public method Static member GetMusicPlaylist
If playlistName == null then gets a copy of the current playlist audioID array, otherwise gets a copy of the playlist with the specified name
Public method Static member GetPlayingAudioObjects(Boolean)
Returns an array of all playing audio objects.
Public method Static member GetPlayingAudioObjects(String, Boolean)
Returns an array of all playing audio objects with the specified audioID.
Public method Static member GetPlayingAudioObjectsCount
Returns the number of all playing audio objects with the specified audioID.
Public method Static member GetPlayingAudioObjectsInCategory
Returns an array of all playing audio objects in the category with name categoryName.
Public method GetPlaylistByName
Retrieves a playlist by name. If playlists are named identically it will return the first one it finds
Public method InitializeAudioItems
Updates the internal audioID dictionary and initializes all registered AudioItem objects.
Public method Static member IsAmbienceSoundEnabled
Determines whether ambience sound is enabled.
Public method Static member IsAmbienceSoundPaused
Uses to test if ambience sound is paused
Public method Static member IsMusicEnabled
Determines whether music is enabled.
Public method Static member IsMusicPaused
Uses to test if music is paused
Public method Static member IsPlaying
Determines whether the specified audio ID is playing.
Public method Static member IsPlaylistPlaying
Determines whether the playlist is playing.
Public method Static member IsSoundMuted
Determines whether sound is muted
Public method Static member IsValidAudioID
Tests if a given audioID is valid.
Public method Static member MuteSound
Mutes / Unmutes the sound.
Public method Static member NewCategory
Creates a new audio category
Public method OnAfterDeserialize
Public method OnBeforeSerialize
Public method Static member PauseAll
Pauses all playing audio items (including the music).
Public method Static member PauseAmbienceSound
Pauses the currently playing ambience sound.
Public method Static member PauseCategory
Pauses all playing audio items in the specified category (including the music).
Public method Static member PauseMusic
Pauses the currently playing music.
Public method Static member Play(String)
Plays an audio item with the name audioID.
Public method Static member Play(String, Transform)
Plays an audio item with the name audioID parented to a specified transform.
Public method Static member Play(String, Vector3, Transform)
Plays an audio item with the name audioID parented to a specified transform with a world offset.
Public method Static member Play(String, Single, Single, Single)
Plays an audio item with the name audioID.
Public method Static member Play(String, Transform, Single, Single, Single)
Plays an audio item with the name audioID parented to a specified transform.
Public method Static member Play(String, Vector3, Transform, Single, Single, Single)
Plays an audio item with the name audioID parented to a specified transform with a world offset.
Public method Static member PlayAfter
Plays an audio item with the name audioID right after the given AudioObject stops playing. (see the Unity AudioSettings.dspTime documentation)
Public method Static member PlayAmbienceSound(String, Single, Single, Single)
Plays an audio item with the name audioID as ambience sound.
Public method Static member PlayAmbienceSound(String, Transform, Single, Single, Single)
Plays an audio item with the name audioID as ambience sound at the specified position.
Public method Static member PlayAmbienceSound(String, Vector3, Transform, Single, Single, Single)
Plays an audio item with the name audioID as ambience sound at the specified position.
Public method PlayAudioItem
Plays a specific AudioItem.
Public method PlayAudioSubItem
Plays a specific AudioSubItem.
Public method Static member PlayMusic(String, Single, Single, Single)
Plays an audio item with the name audioID as music.
Public method Static member PlayMusic(String, Transform, Single, Single, Single)
Plays an audio item with the name audioID as music at the specified position.
Public method Static member PlayMusic(String, Vector3, Transform, Single, Single, Single)
Plays an audio item with the name audioID as music at the specified position.
Public method Static member PlayMusicPlaylist
Start playing the music playlist.
Public method Static member PlayNextMusicOnPlaylist
Jumps to the next the music track on the playlist.
Public method Static member PlayPreviousMusicOnPlaylist
Jumps to the previous music track on the playlist.
Public method Static member PlayScheduled
Plays an audio item with the name audioID parented to a specified transform with a world offset scheduled at a specified high precision DSP time (see the Unity AudioSettings.dspTime documentation)
Public method Static member RemoveAudioItem
Removes an AudioItem from the AudioController.
Public method Static member RemoveCategory
Removes an audio category.
Public method Static member SetCategoryVolume
Changes the category volume. Also effects currently playing audio items.
Public method Static member SetCurrentMusicPlaylist
Sets the current playlist to the specified audioID array
Public method Static member SetGlobalVolume
Changes the global volume. Effects all currently playing audio items.
Public method Static member Stop(String)
Stops all playing audio items with name audioID.
Public method Static member Stop(String, Single)
Stops all playing audio items with name audioID with a fade-out.
Public method Static member StopAll()()()()
Immediately stops playing audio items (including the music).
Public method Static member StopAll(Single)
Fades out all playing audio items (including the music).
Public method Static member StopAmbienceSound()()()()
Stops the currently playing ambience sound.
Public method Static member StopAmbienceSound(Single)
Stops the currently playing ambience sound with fade-out.
Public method Static member StopCategory
Stops all playing audio items in the specified category (including the music).
Public method Static member StopMusic()()()()
Stops the currently playing music.
Public method Static member StopMusic(Single)
Stops the currently playing music with fade-out.
Public method UnloadAllAudioClips
Unloads all AudioClips specified in this AudioController from memory.
Public method Static member UnpauseAll
Un-pauses all playing audio items (including the music).
Public method Static member UnpauseAmbienceSound
Unpauses the current ambience sound.
Public method Static member UnpauseCategory
Un-pauses all playing audio items in the specified category (including the music).
Public method Static member UnpauseMusic
Unpauses the current music.

Fields

  Name Description
Public field _currentInspectorSelection
Public field ambienceSoundCrossFadeTime
If set to a value > 0 (in seconds) music will automatically be cross-faded with this fading time.
Public field Static member AUDIO_TOOLKIT_VERSION
A string containing the version number of the Audio Toolkit
Public field AudioCategories
Specify your audio categories here using the Unity inspector.
Public field AudioObjectPrefab
You must specify your AudioObject prefab here using the Unity inspector.
  • AudioObjectAudioSource (Unity built-in)PoolableObject - only required if pooling is uses
Public field crossfadePlaylist
if enabled, the tracks on the playlist will get cross-faded as specified by musicCrossFadeTime
Public field delayBetweenPlaylistTracks
Mute time in between two tracks on the playlist.
Public field EqualPowerCrossfade
If enabled fading is adjusted in a way so that cross-fades should result in the same power during the time of fadeing
Public field loopPlaylist
specifies if the music playlist will get looped
Public field musicCrossFadeTime
If set to a value > 0 (in seconds) music will automatically be cross-faded with this fading time.
Public field musicPlaylist Obsolete.
For backwards compatibility we still keep the old playlist system, its items will be copied over to the Default Playlist and then cleared
Public field musicPlaylists
allows to specify a list of named playlist that can be played as music
Public field Persistent
If enabled, the audio controller will survive scene changes
Public field PlayWithZeroVolume
If disabled, audios are not played if they have a resulting volume of zero.
Public field shufflePlaylist
enables / disables shuffling for the music playlist
Public field specifyCrossFadeInAndOutSeperately
If enabled specific music and ambience sound cross-fading in and out times can be specified with musicCrossFadeTime_In and musicCrossFadeTime_Out respectively ambienceSoundCrossFadeTime_In and ambienceSoundCrossFadeTime_Out
Public field UnloadAudioClipsOnDestroy
If enabled all audio resources (AudioClips) specified in this AudioController are unloaded from memory when the AudioController gets destroyed (e.g. when loading a new scene and Persistent is not enabled)
Public field UsePooledAudioObjects
Enables / Disables AudioObject pooling

Properties

  Name Description
Public property ambienceSoundCrossFadeTime_In
Specifies a specific fade-in time for ambience sound cross fading. Only meaningful if specifyCrossFadeInAndOutSeperately is enabled.
Public property ambienceSoundCrossFadeTime_Out
Specifies a specific fade-out time for ambience sound cross fading. Only meaningful if specifyCrossFadeInAndOutSeperately is enabled.
Public property ambienceSoundEnabled
Gets or sets the ambienceSoundEnabled.
Public property DisableAudio
Disables all audio playback.
Public property isAdditionalAudioController
You may use several AudioControllers in the same scene in parallel. All but one (the main controller) must be marked as 'additional'. You can play audio items of any of those controllers with the normal Play() calls.
Public property isSingletonObject
returns true if the AudioController is the main controller (not an additional controller)
(Overrides SingletonMonoBehaviour<(Of <(<'T>)>)>..::..isSingletonObject.)
Public property musicCrossFadeTime_In
Specifies a specific fade-in time for music cross fading. Only meaningful if specifyCrossFadeInAndOutSeperately is enabled.
Public property musicCrossFadeTime_Out
Specifies a specific fade-out time for music cross fading. Only meaningful if specifyCrossFadeInAndOutSeperately is enabled.
Public property musicEnabled
Gets or sets the musicEnabled.
Public property soundMuted
Gets or sets the soundMuted.
Public property Static member systemDeltaTime
Returns the high precision audio system delta time since the last frame update.
Public property Static member systemTime
Returns the high precision audio system time size the application launch.
Public property Volume
The global volume applied to all categories. You change the volume by script and the change will be apply to all playing audios immediately.

See Also