AudioController Methods

Audio Toolkit

Collapse image Expand Image Copy image CopyHover image

The AudioController type exposes the following members.

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.

See Also