( Default Namespace ) Namespace

ClockStone Audio Toolkit for Unity - Documentation
( Default Namespace ) Namespace
Send Feedback
Audio Toolkit provides an easy-to-use and performance optimized framework to play and manage music and sound effects in Unity.

Classes

 | Class | Description
Public class | AudioCategory | An audio category represents a set of AudioItems. Categories allow to change the volume of all containing audio items.
Public class | AudioController | The audio managing class used to define and play audio items and categories.
Public class | AudioItem | The AudioItem class represents a uniquely named audio entity that can be played by scripts.
Public class | AudioObject | The object playing the audio clip associated with a AudioSubItem
Public class | AudioSubItem | An AudioSubItem represents a specific Unity audio clip.
Public class | ObjectPoolController | A static class used to create and destroy poolable objects.
Public class | PoolableObject | Add this component to your prefab to make it poolable.
Public class | PoolableReference<(Of <(<'T>)>)> | Auxiliary class to overcome the problem of references to pooled objects that should become null when objects are moved back to the pool after calling Destroy(GameObject).
Public class | RegisteredComponent | Derive your MonoBehaviour class from RegisteredComponent and all references to instances of this component will be saved in an internal array. Use GetAllOfType<(Of <<'(T>)>>)()()()() to retrieve this array, which is much faster than using Unity's GameObject.FindObjectsOfType() function.
Public class | RegisteredComponentController | This controller provides fast access to all currently existing RegisteredComponent instances.
Public class | SingletonMonoBehaviour<(Of <(<'T>)>)> | Provides singleton-like access to a unique instance of a MonoBehaviour.

Interfaces

 | Interface | Description
Public interface | IRegisteredComponent |

Delegates

 | Delegate | Description
Public delegate | AudioObject..::..AudioEventDelegate | The audio event delegate type.

Enumerations

 | Enumeration | Description
Public enumeration | AudioItem..::..LoopMode | AudioItem loop mode.
Public enumeration | AudioPickSubItemMode | Used by AudioItem to determine which AudioSubItem is chosen.
Public enumeration | AudioSubItemType | The type of an AudioSubItem

Send comments on this topic to ClockStone Support Email

Copyright (c) 2012 by ClockStone Software GmbH


AudioCategory Class

AudioCategory Class
Members See Also Send Feedback
An audio category represents a set of AudioItems. Categories allow to change the volume of all containing audio items.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
[SerializableAttribute]
public class AudioCategory

Inheritance Hierarchy

System..::..Object
(Default Namespace)..::..AudioCategory

See Also

AudioCategory Members
(Default Namespace) Namespace


AudioCategory Members

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioCategory Members
AudioCategory Class Constructors Methods Fields Properties See Also Send Feedback

The AudioCategory type exposes the following members.

Constructors

 | Name | Description
Public method | AudioCategory | Instantiates an AudioCategory

Methods

 | Name | Description
Public method | UnloadAllAudioClips | Unloads all AudioClips specified in the subitems from memory.

Fields

 | Name | Description
Public field | AudioItems | Define your AudioItems using Unity inspector.
Public field | AudioObjectPrefab | Allows to define a specific audio object prefab for this category. If none is defined, the default prefab as set by AudioObjectPrefab is taken.
Public field | Name | The name of category ( = categoryID )

Properties

 | Name | Description
Public property | audioController | The AudioController the category belongs to
Public property | parentCategory | If a parent category is specified, the category inherits the volume of its parent.
Public property | Volume | The volume factor applied to all audio items in the category (NOT including a possible parentCategory) If you change the volume by script the change will be applied to all playing audios immediately.
Public property | VolumeTotal | The volume factor applied to all audio items in the category (including a possible parentCategory)

See Also

AudioCategory Class


AudioCategory Constructor

AudioCategory Constructor
AudioCategory Class See Also Send Feedback
Instantiates an AudioCategory

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioCategory(
    AudioController audioController
)

Parameters

audioController
Type: (Default Namespace)..::..AudioController
The AudioController the category belongs to.

See Also

AudioCategory Class


AudioCategory Fields

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioCategory Fields
AudioCategory Class See Also Send Feedback

The AudioCategory type exposes the following members.

Fields

 | Name | Description
Public field | AudioItems | Define your AudioItems using Unity inspector.
Public field | AudioObjectPrefab | Allows to define a specific audio object prefab for this category. If none is defined, the default prefab as set by AudioObjectPrefab is taken.
Public field | Name | The name of category ( = categoryID )

See Also

AudioCategory Class


AudioItems Field

AudioCategory..::..AudioItems Field
AudioCategory Class See Also Send Feedback
Define your AudioItems using Unity inspector.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioItem[] AudioItems

See Also

AudioCategory Class


AudioObjectPrefab Field

AudioCategory..::..AudioObjectPrefab Field
AudioCategory Class See Also Send Feedback
Allows to define a specific audio object prefab for this category. If none is defined, the default prefab as set by AudioObjectPrefab is taken.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public GameObject AudioObjectPrefab

Remarks

This way you can e.g. use special effects such as the reverb filter for a specific category. Just add the respective filter component to the specified prefab.

See Also

AudioCategory Class


Name Field

AudioCategory..::..Name Field
AudioCategory Class See Also Send Feedback
The name of category ( = categoryID )

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public string Name

See Also

AudioCategory Class


AudioCategory Methods

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioCategory Methods
AudioCategory Class See Also Send Feedback

The AudioCategory type exposes the following members.

Methods

 | Name | Description
Public method | UnloadAllAudioClips | Unloads all AudioClips specified in the subitems from memory.

See Also

AudioCategory Class


UnloadAllAudioClips Method

AudioCategory..::..UnloadAllAudioClips Method
AudioCategory Class See Also Send Feedback
Unloads all AudioClips specified in the subitems from memory.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void UnloadAllAudioClips()

Remarks

You will still be able to play the AudioClips, but you may experience performance hickups when Unity reloads the audio asset

See Also

AudioCategory Class


AudioCategory Properties

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioCategory Properties
AudioCategory Class See Also Send Feedback

The AudioCategory type exposes the following members.

Properties

 | Name | Description
Public property | audioController | The AudioController the category belongs to
Public property | parentCategory | If a parent category is specified, the category inherits the volume of its parent.
Public property | Volume | The volume factor applied to all audio items in the category (NOT including a possible parentCategory) If you change the volume by script the change will be applied to all playing audios immediately.
Public property | VolumeTotal | The volume factor applied to all audio items in the category (including a possible parentCategory)

See Also

AudioCategory Class


audioController Property

AudioCategory..::..audioController Property
AudioCategory Class See Also Send Feedback
The AudioController the category belongs to

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioController audioController { get; set; }

See Also

AudioCategory Class


parentCategory Property

AudioCategory..::..parentCategory Property
AudioCategory Class See Also Send Feedback
If a parent category is specified, the category inherits the volume of its parent.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioCategory parentCategory { get; set; }

See Also

AudioCategory Class


Volume Property

AudioCategory..::..Volume Property
AudioCategory Class See Also Send Feedback
The volume factor applied to all audio items in the category (NOT including a possible parentCategory) If you change the volume by script the change will be applied to all playing audios immediately.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float Volume { get; set; }

See Also

AudioCategory Class


VolumeTotal Property

AudioCategory..::..VolumeTotal Property
AudioCategory Class See Also Send Feedback
The volume factor applied to all audio items in the category (including a possible parentCategory)

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float VolumeTotal { get; }

See Also

AudioCategory Class


AudioController Class

AudioController Class
Members Example See Also Send Feedback
The audio managing class used to define and play audio items and categories.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public class AudioController : SingletonMonoBehaviour<AudioController>

Remarks

At least one instance of an AudioController must exist in each scene using the Audio Toolkit. Usually there is exactly one controller, but you can have additional controllers if they are marked as such (in the Unity insepector, see isAdditionalAudioController) There a two options when setting up an AudioController. Either you can specify all audio files that are used in your entire project in one single AudioController. Then add this AudioController to your initial scene and set it persistent from within the inspector, so it will survive when a new scene is loaded. This way all audios are accessible from within your entire application. If you have a lot of audio files though, this may lead to a lengthy loading time and will have a rather large memory footprint. To avoid this, you can alternatively set up a specific AudioController for each scene which only contains those audio files needed in the particular scene.

Examples

Once you have defined your audio categories and items in the Unity inspector you can play music and sound effects very easily:
CopyC#
AudioController.Play( "MySoundEffect1" );
AudioController.Play( "MySoundEffect2", new Vector3( posX, posY, posZ ) );
AudioController.PlayMusic( "MusicTrack1" );
AudioController.SetCategoryVolume( "Music", 0.5f );
AudioController.PauseMusic();

Inheritance Hierarchy

System..::..Object
Object
Component
Behaviour
MonoBehaviour
(Default Namespace)..::..SingletonMonoBehaviour <(Of <(<'AudioController>)>)>
(Default Namespace)..::..AudioController

See Also

AudioController Members


AudioController Members

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioController Members
AudioController Class Constructors Methods Fields Properties See Also Send Feedback

The AudioController type exposes the following members.

Constructors

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

Methods

 | Name | Description
 | AddToCategory(AudioCategory, AudioItem) | Adds a custom audio item to a category.
 | 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.
 | ClearPlaylist | Clears the music playlist.
 | DetachAllAudios | Detaches all audio objects possibly parented to the specified game object.
 | EnableMusic | Enables the music.
 | EnqueueMusic | Enqueues an audio ID to the music playlist queue.
 | GetAudioItem | Returns the AudioItem with the given audioID.
 | GetAudioItemMaxDistance | Gets the audio item's max distance. (respects all proper default values and overwrites).
 | GetCategory | Gets a category.
 | GetCategoryVolume | Gets the category volume.
 | GetCurrentAudioListener | Gets the currently active Unity audio listener.
 | GetCurrentMusic | Gets the current music.
 | GetGlobalVolume | Gets the global volume.
 | GetMusicPlaylist | Gets a copy of the current playlist audioID array
 | GetPlayingAudioObjects(Boolean) | Returns an array of all playing audio objects.
 | GetPlayingAudioObjects(String, Boolean) | Returns an array of all playing audio objects with the specified audioID.
 | GetPlayingAudioObjectsCount | Returns the number of all playing audio objects with the specified audioID.
 | GetPlayingAudioObjectsInCategory | Returns an array of all playing audio objects in the category with name categoryName.
Public method | InitializeAudioItems | Updates the internal audioID dictionary and initializes all registered AudioItem objects.
 | IsMusicEnabled | Determines whether music is enabled.
 | IsMusicPaused | Uses to test if music is paused
 | IsPlaying | Determines whether the specified audio ID is playing.
 | IsPlaylistPlaying | Determines whether the playlist is playing.
 | IsValidAudioID | Tests if a given audioID is valid.
 | NewCategory | Creates a new audio category
 | PauseAll | Pauses all playing audio items (including the music).
 | PauseCategory | Pauses all playing audio items in the specified category (including the music).
 | PauseMusic | Pauses the currently playing music.
 | Play(String) | Plays an audio item with the name audioID.
 | Play(String, Transform) | Plays an audio item with the name audioID parented to a specified transform.
 | Play(String, Vector3, Transform) | Plays an audio item with the name audioID parented to a specified transform with a world offset.
 | Play(String, Single, Single, Single) | Plays an audio item with the name audioID.
 | Play(String, Transform, Single, Single, Single) | Plays an audio item with the name audioID parented to a specified transform.
 | Play(String, Vector3, Transform, Single, Single, Single) | Plays an audio item with the name audioID parented to a specified transform with a world offset.
 | PlayAfter | Plays an audio item with the name audioID right after the given AudioObject stops playing. (see the Unity AudioSettings.dspTime documentation)
Public method | PlayAudioItem | Plays a specific AudioItem.
Public method | PlayAudioSubItem | Plays a specific AudioSubItem.
 | PlayMusic(String) | Plays an audio item with the name audioID as music.
 | PlayMusic(String, Single) | Plays an audio item with the name audioID as music.
 | PlayMusic(String, Single, Single, Single) | Plays an audio item with the name audioID as music.
 | PlayMusic(String, Transform, Single, Single, Single) | Plays an audio item with the name audioID as music at the specified position.
 | PlayMusic(String, Vector3, Transform, Single, Single, Single) | Plays an audio item with the name audioID as music at the specified position.
 | PlayMusicPlaylist | Start playing the music playlist.
 | PlayNextMusicOnPlaylist | Jumps to the next the music track on the playlist.
 | PlayPreviousMusicOnPlaylist | Jumps to the previous music track on the playlist.
 | 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)
 | RemoveAudioItem | Removes an AudioItem from the AudioController.
 | RemoveCategory | Removes an audio category.
 | SetCategoryVolume | Changes the category volume. Also effects currently playing audio items.
 | SetGlobalVolume | Changes the global volume. Effects all currently playing audio items.
 | SetMusicPlaylist | Sets the current playlist to the specified audioID array
 | Stop(String) | Stops all playing audio items with name audioID.
 | Stop(String, Single) | Stops all playing audio items with name audioID with a fade-out.
 | StopAll()()()() | Immediately stops playing audio items (including the music).
 | StopAll(Single) | Fades out all playing audio items (including the music).
 | StopMusic()()()() | Stops the currently playing music.
 | StopMusic(Single) | Stops the currently playing music with fade-out.
Public method | UnloadAllAudioClips | Unloads all AudioClips specified in this AudioController from memory.
 | UnpauseAll | Un-pauses all playing audio items (including the music).
 | UnpauseCategory | Un-pauses all playing audio items in the specified category (including the music).
 | UnpauseMusic | Unpauses the current music.

Fields

Name | Description
Public field | _currentInspectorSelection
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
allows to specify a list of audioID that will be played as music one after the other
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 cross-fading in and out times can be specified with musicCrossFadeTime_In and musicCrossFadeTime_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 | 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.
 | systemDeltaTime | Returns the high precision audio system delta time since the last frame update.
 | 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

AudioController Class


AudioController Constructor

AudioController Constructor
AudioController Class See Also Send Feedback
Initializes a new instance of the AudioController class

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioController()

See Also

AudioController Class


AudioController Fields

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioController Fields
AudioController Class See Also Send Feedback

The AudioController type exposes the following members.

Fields

Name | Description
Public field | _currentInspectorSelection
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
allows to specify a list of audioID that will be played as music one after the other
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 cross-fading in and out times can be specified with musicCrossFadeTime_In and musicCrossFadeTime_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

See Also

AudioController Class


_currentInspectorSelection Field

AudioController..::.._currentInspectorSelection Field
AudioController Class See Also Send Feedback

[Missing <summary> documentation for "F:AudioController._currentInspectorSelection"]

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioController_CurrentInspectorSelection _currentInspectorSelection

See Also

AudioController Class


AUDIO_TOOLKIT_VERSION Field

AudioController..::..AUDIO_TOOLKIT_VERSION Field
AudioController Class See Also Send Feedback
A string containing the version number of the Audio Toolkit

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public const string AUDIO_TOOLKIT_VERSION

See Also

AudioController Class


AudioCategories Field

AudioController..::..AudioCategories Field
AudioController Class See Also Send Feedback
Specify your audio categories here using the Unity inspector.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioCategory[] AudioCategories

See Also

AudioController Class


AudioObjectPrefab Field

AudioController..::..AudioObjectPrefab Field
AudioController Class See Also Send Feedback
You must specify your AudioObject prefab here using the Unity inspector.
  • AudioObjectAudioSource (Unity built-in)PoolableObject - only required if pooling is uses

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public GameObject AudioObjectPrefab

See Also

AudioController Class


crossfadePlaylist Field

AudioController..::..crossfadePlaylist Field
AudioController Class See Also Send Feedback
if enabled, the tracks on the playlist will get cross-faded as specified by musicCrossFadeTime

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool crossfadePlaylist

See Also

AudioController Class


delayBetweenPlaylistTracks Field

AudioController..::..delayBetweenPlaylistTracks Field
AudioController Class See Also Send Feedback
Mute time in between two tracks on the playlist.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float delayBetweenPlaylistTracks

See Also

AudioController Class


EqualPowerCrossfade Field

AudioController..::..EqualPowerCrossfade Field
AudioController Class See Also Send Feedback
If enabled fading is adjusted in a way so that cross-fades should result in the same power during the time of fadeing

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool EqualPowerCrossfade

Remarks

Unfortunately not 100% correct as Unity uses unknown internal formulas for computing the volume.

See Also

AudioController Class


loopPlaylist Field

AudioController..::..loopPlaylist Field
AudioController Class See Also Send Feedback
specifies if the music playlist will get looped

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool loopPlaylist

See Also

AudioController Class


musicCrossFadeTime Field

AudioController..::..musicCrossFadeTime Field
AudioController Class See Also Send Feedback
If set to a value > 0 (in seconds) music will automatically be cross-faded with this fading time.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float musicCrossFadeTime

Remarks

if specifyCrossFadeInAndOutSeperately is enabled, musicCrossFadeTime_In and musicCrossFadeTime_Out are used instead.

See Also

AudioController Class


musicPlaylist Field

AudioController..::..musicPlaylist Field
AudioController Class See Also Send Feedback
allows to specify a list of audioID that will be played as music one after the other

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public string[] musicPlaylist

See Also

AudioController Class


Persistent Field

AudioController..::..Persistent Field
AudioController Class See Also Send Feedback
If enabled, the audio controller will survive scene changes

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool Persistent

Remarks

For projects with a large number of audio files you may consider having separate AudioController version for each scene and only specify those audio items that are really required in this scene. This can reduce memory consumption and speed up loading time for the initial scene.

See Also

AudioController Class


PlayWithZeroVolume Field

AudioController..::..PlayWithZeroVolume Field
AudioController Class See Also Send Feedback
If disabled, audios are not played if they have a resulting volume of zero.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool PlayWithZeroVolume

See Also

AudioController Class


shufflePlaylist Field

AudioController..::..shufflePlaylist Field
AudioController Class See Also Send Feedback
enables / disables shuffling for the music playlist

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool shufflePlaylist

See Also

AudioController Class


specifyCrossFadeInAndOutSeperately Field

AudioController..::..specifyCrossFadeInAndOutSeperately Field
AudioController Class See Also Send Feedback
If enabled specific music cross-fading in and out times can be specified with musicCrossFadeTime_In and musicCrossFadeTime_Out

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool specifyCrossFadeInAndOutSeperately

See Also

AudioController Class


UnloadAudioClipsOnDestroy Field

AudioController..::..UnloadAudioClipsOnDestroy Field
AudioController Class See Also Send Feedback
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)

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool UnloadAudioClipsOnDestroy

Remarks

Uses Unity's Resources.UnloadAsset(...) method. Can be used to save memory if many audio ressources are in use. It is recommended to use additional AudioControllers for audios that are used only within a specific scene, and a primary persistent AudioController for audio used throughout the entire application.

See Also

AudioController Class


UsePooledAudioObjects Field

AudioController..::..UsePooledAudioObjects Field
AudioController Class See Also Send Feedback
Enables / Disables AudioObject pooling

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool UsePooledAudioObjects

Remarks

Warning: Use PoolableReference<(Of <(<'T>)>)> to store an AudioObject reference if you have pooling enabled.

See Also

AudioController Class


AudioController Methods

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioController Methods
AudioController Class See Also Send Feedback

The AudioController type exposes the following members.

Methods

 | Name | Description
 | AddToCategory(AudioCategory, AudioItem) | Adds a custom audio item to a category.
 | 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.
 | ClearPlaylist | Clears the music playlist.
 | DetachAllAudios | Detaches all audio objects possibly parented to the specified game object.
 | EnableMusic | Enables the music.
 | EnqueueMusic | Enqueues an audio ID to the music playlist queue.
 | GetAudioItem | Returns the AudioItem with the given audioID.
 | GetAudioItemMaxDistance | Gets the audio item's max distance. (respects all proper default values and overwrites).
 | GetCategory | Gets a category.
 | GetCategoryVolume | Gets the category volume.
 | GetCurrentAudioListener | Gets the currently active Unity audio listener.
 | GetCurrentMusic | Gets the current music.
 | GetGlobalVolume | Gets the global volume.
 | GetMusicPlaylist | Gets a copy of the current playlist audioID array
 | GetPlayingAudioObjects(Boolean) | Returns an array of all playing audio objects.
 | GetPlayingAudioObjects(String, Boolean) | Returns an array of all playing audio objects with the specified audioID.
 | GetPlayingAudioObjectsCount | Returns the number of all playing audio objects with the specified audioID.
 | GetPlayingAudioObjectsInCategory | Returns an array of all playing audio objects in the category with name categoryName.
Public method | InitializeAudioItems | Updates the internal audioID dictionary and initializes all registered AudioItem objects.
 | IsMusicEnabled | Determines whether music is enabled.
 | IsMusicPaused | Uses to test if music is paused
 | IsPlaying | Determines whether the specified audio ID is playing.
 | IsPlaylistPlaying | Determines whether the playlist is playing.
 | IsValidAudioID | Tests if a given audioID is valid.
 | NewCategory | Creates a new audio category
 | PauseAll | Pauses all playing audio items (including the music).
 | PauseCategory | Pauses all playing audio items in the specified category (including the music).
 | PauseMusic | Pauses the currently playing music.
 | Play(String) | Plays an audio item with the name audioID.
 | Play(String, Transform) | Plays an audio item with the name audioID parented to a specified transform.
 | Play(String, Vector3, Transform) | Plays an audio item with the name audioID parented to a specified transform with a world offset.
 | Play(String, Single, Single, Single) | Plays an audio item with the name audioID.
 | Play(String, Transform, Single, Single, Single) | Plays an audio item with the name audioID parented to a specified transform.
 | Play(String, Vector3, Transform, Single, Single, Single) | Plays an audio item with the name audioID parented to a specified transform with a world offset.
 | PlayAfter | Plays an audio item with the name audioID right after the given AudioObject stops playing. (see the Unity AudioSettings.dspTime documentation)
Public method | PlayAudioItem | Plays a specific AudioItem.
Public method | PlayAudioSubItem | Plays a specific AudioSubItem.
 | PlayMusic(String) | Plays an audio item with the name audioID as music.
 | PlayMusic(String, Single) | Plays an audio item with the name audioID as music.
 | PlayMusic(String, Single, Single, Single) | Plays an audio item with the name audioID as music.
 | PlayMusic(String, Transform, Single, Single, Single) | Plays an audio item with the name audioID as music at the specified position.
 | PlayMusic(String, Vector3, Transform, Single, Single, Single) | Plays an audio item with the name audioID as music at the specified position.
 | PlayMusicPlaylist | Start playing the music playlist.
 | PlayNextMusicOnPlaylist | Jumps to the next the music track on the playlist.
 | PlayPreviousMusicOnPlaylist | Jumps to the previous music track on the playlist.
 | 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)
 | RemoveAudioItem | Removes an AudioItem from the AudioController.
 | RemoveCategory | Removes an audio category.
 | SetCategoryVolume | Changes the category volume. Also effects currently playing audio items.
 | SetGlobalVolume | Changes the global volume. Effects all currently playing audio items.
 | SetMusicPlaylist | Sets the current playlist to the specified audioID array
 | Stop(String) | Stops all playing audio items with name audioID.
 | Stop(String, Single) | Stops all playing audio items with name audioID with a fade-out.
 | StopAll()()()() | Immediately stops playing audio items (including the music).
 | StopAll(Single) | Fades out all playing audio items (including the music).
 | StopMusic()()()() | Stops the currently playing music.
 | StopMusic(Single) | Stops the currently playing music with fade-out.
Public method | UnloadAllAudioClips | Unloads all AudioClips specified in this AudioController from memory.
 | UnpauseAll | Un-pauses all playing audio items (including the music).
 | UnpauseCategory | Un-pauses all playing audio items in the specified category (including the music).
 | UnpauseMusic | Unpauses the current music.

See Also

AudioController Class


AddToCategory Method

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioController..::..AddToCategory Method
AudioController Class See Also Send Feedback

Overload List

Name | Description
AddToCategory(AudioCategory, AudioItem) | Adds a custom audio item to a category.
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.

See Also

AudioController Class
AudioController Members


AddToCategory Method (AudioCategory, AudioItem)

AudioController..::..AddToCategory Method (AudioCategory, AudioItem)
AudioController Class Example See Also Send Feedback
Adds a custom audio item to a category.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static void AddToCategory(
    AudioCategory category,
    AudioItem audioItem
)

Parameters

category
Type: (Default Namespace)..::..AudioCategory
The category.
audioItem
Type: (Default Namespace)..::..AudioItem
The audio item.

Examples

CopyC#
var audioItem = new AudioItem();
audioItem.SubItemPickMode = AudioPickSubItemMode.Sequence;

audioItem.subItems = new AudioSubItem[ 2 ];

audioItem.subItems[ 0 ] = new AudioSubItem();
audioItem.subItems[ 0 ].Clip = audioClip0;
audioItem.subItems[ 0 ].Volume = 0.7f;

audioItem.subItems[ 1 ] = new AudioSubItem();
audioItem.subItems[ 1 ].Clip = audioClip1;
audioItem.subItems[ 1 ].Volume = 0.8f;

AddToCategory( GetCategory( "CustomSFX" ), audioItem );

See Also

AudioController Class
AddToCategory Overload
(Default Namespace) Namespace
AudioController..::..NewCategory(String)
AudioController..::..GetCategory(String)


AddToCategory Method (AudioCategory, , String)

AudioController..::..AddToCategory Method (AudioCategory, , String)
AudioController Class See Also Send Feedback
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.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioItem AddToCategory(
    AudioCategory category,
    AudioClip audioClip,
    string audioID
)

Parameters

category
Type: (Default Namespace)..::..AudioCategory
The category.
audioClip
Type: AudioClip
The custom audio clip.
audioID
Type: System..::..String
The audioID for the AudioItem to create.

Return Value

The AudioItem created with the specified audioID

See Also

AudioController Class
AddToCategory Overload
(Default Namespace) Namespace
AudioController..::..NewCategory(String)
AudioController..::..GetCategory(String)


ClearPlaylist Method

AudioController..::..ClearPlaylist Method
AudioController Class See Also Send Feedback
Clears the music playlist.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static void ClearPlaylist()

See Also

AudioController Class


DetachAllAudios Method

AudioController..::..DetachAllAudios Method
AudioController Class See Also Send Feedback
Detaches all audio objects possibly parented to the specified game object.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static void DetachAllAudios(
    GameObject gameObjectWithAudios
)

Parameters

gameObjectWithAudios
Type: GameObject
The GameObject with possibly playing AudioObjects.

Remarks

Use this method on a game object BEFORE destryoing it if you want to keep any audios playing parented to this object.

See Also

AudioController Class


EnableMusic Method

AudioController..::..EnableMusic Method
AudioController Class See Also Send Feedback
Enables the music.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static void EnableMusic(
    bool b
)

Parameters

b
Type: System..::..Boolean
if set to true [b].

See Also

AudioController Class


EnqueueMusic Method

AudioController..::..EnqueueMusic Method
AudioController Class See Also Send Feedback
Enqueues an audio ID to the music playlist queue.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static int EnqueueMusic(
    string audioID
)

Parameters

audioID
Type: System..::..String
The audio ID.

Return Value

The number of music tracks on the playlist.

See Also

AudioController Class


GetAudioItem Method

AudioController..::..GetAudioItem Method
AudioController Class See Also Send Feedback
Returns the AudioItem with the given audioID.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioItem GetAudioItem(
    string audioID
)

Parameters

audioID
Type: System..::..String
The audioID

Return Value

The AudioItem if audioID is valid, else null

See Also

AudioController Class


GetAudioItemMaxDistance Method

AudioController..::..GetAudioItemMaxDistance Method
AudioController Class See Also Send Feedback
Gets the audio item's max distance. (respects all proper default values and overwrites).

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static float GetAudioItemMaxDistance(
    string audioID
)

Parameters

audioID
Type: System..::..String
The audioID

Return Value

The max distance applied to the AudioSource

See Also

AudioController Class


GetCategory Method

AudioController..::..GetCategory Method
AudioController Class See Also Send Feedback
Gets a category.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioCategory GetCategory(
    string name
)

Parameters

name
Type: System..::..String
The category's name.

Return Value

The category or null if no category with the specified name exists

See Also

AudioController Class


GetCategoryVolume Method

AudioController..::..GetCategoryVolume Method
AudioController Class See Also Send Feedback
Gets the category volume.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static float GetCategoryVolume(
    string name
)

Parameters

name
Type: System..::..String
The category name.

Return Value

The volume of the specified category

See Also

AudioController Class


GetCurrentAudioListener Method

AudioController..::..GetCurrentAudioListener Method
AudioController Class See Also Send Feedback
Gets the currently active Unity audio listener.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioListener GetCurrentAudioListener()

Return Value

Reference of the currently active AudioListener object.

See Also

AudioController Class


GetCurrentMusic Method

AudioController..::..GetCurrentMusic Method
AudioController Class See Also Send Feedback
Gets the current music.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioObject GetCurrentMusic()

Return Value

Returns a reference to the AudioObject that is currently playing the music.

See Also

AudioController Class


GetGlobalVolume Method

AudioController..::..GetGlobalVolume Method
AudioController Class See Also Send Feedback
Gets the global volume.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static float GetGlobalVolume()

Return Value

The global volume (between 0 and 1).

See Also

AudioController Class


GetMusicPlaylist Method

AudioController..::..GetMusicPlaylist Method
AudioController Class See Also Send Feedback
Gets a copy of the current playlist audioID array

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static string[] GetMusicPlaylist()

Return Value

The playlist array

See Also

AudioController Class


GetPlayingAudioObjects Method

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioController..::..GetPlayingAudioObjects Method
AudioController Class See Also Send Feedback

Overload List

Name | Description
GetPlayingAudioObjects(Boolean) | Returns an array of all playing audio objects.
GetPlayingAudioObjects(String, Boolean) | Returns an array of all playing audio objects with the specified audioID.

See Also

AudioController Class
AudioController Members


GetPlayingAudioObjects Method (Boolean)

AudioController..::..GetPlayingAudioObjects Method (Boolean)
AudioController Class See Also Send Feedback
Returns an array of all playing audio objects.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioObject[] GetPlayingAudioObjects(
    bool includePausedAudio
)

Parameters

includePausedAudio
Type: System..::..Boolean
If enabled the returned array will also contain paused audios.

Return Value

Array of all playing audio objects.

See Also

AudioController Class
GetPlayingAudioObjects Overload


GetPlayingAudioObjects Method (String, Boolean)

AudioController..::..GetPlayingAudioObjects Method (String, Boolean)
AudioController Class See Also Send Feedback
Returns an array of all playing audio objects with the specified audioID.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioObject[] GetPlayingAudioObjects(
    string audioID,
    bool includePausedAudio
)

Parameters

audioID
Type: System..::..String
The audio ID.
includePausedAudio
Type: System..::..Boolean
If enabled the returned array will also contain paused audios.

Return Value

Array of all playing audio objects with the specified audioID.

See Also

AudioController Class
GetPlayingAudioObjects Overload


GetPlayingAudioObjectsCount Method

AudioController..::..GetPlayingAudioObjectsCount Method
AudioController Class See Also Send Feedback
Returns the number of all playing audio objects with the specified audioID.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static int GetPlayingAudioObjectsCount(
    string audioID,
    bool includePausedAudio
)

Parameters

audioID
Type: System..::..String
The audio ID.
includePausedAudio
Type: System..::..Boolean
If enabled the returned array will also contain paused audios.

Return Value

Number of all playing audio objects with the specified audioID.

See Also

AudioController Class


GetPlayingAudioObjectsInCategory Method

AudioController..::..GetPlayingAudioObjectsInCategory Method
AudioController Class See Also Send Feedback
Returns an array of all playing audio objects in the category with name categoryName.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioObject[] GetPlayingAudioObjectsInCategory(
    string categoryName,
    bool includePausedAudio
)

Parameters

categoryName
Type: System..::..String
The category name.
includePausedAudio
Type: System..::..Boolean
If enabled the returned array will also contain paused audios.

Return Value

Array of all playing audio objects belonging to the specified category or one of its child categories.

See Also

AudioController Class


InitializeAudioItems Method

AudioController..::..InitializeAudioItems Method
AudioController Class See Also Send Feedback
Updates the internal audioID dictionary and initializes all registered AudioItem objects.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void InitializeAudioItems()

Remarks

There is no need to call this function manually, unless AudioItem objects or categories are changed at runtime.

See Also

AudioController Class


IsMusicEnabled Method

AudioController..::..IsMusicEnabled Method
AudioController Class See Also Send Feedback
Determines whether music is enabled.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static bool IsMusicEnabled()

Return Value

true if music is enabled; otherwise, false.

See Also

AudioController Class


IsMusicPaused Method

AudioController..::..IsMusicPaused Method
AudioController Class See Also Send Feedback
Uses to test if music is paused

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static bool IsMusicPaused()

Return Value

true if music is paused, otherwise false

See Also

AudioController Class


IsPlaying Method

AudioController..::..IsPlaying Method
AudioController Class See Also Send Feedback
Determines whether the specified audio ID is playing.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static bool IsPlaying(
    string audioID
)

Parameters

audioID
Type: System..::..String
The audio ID.

Return Value

true if the specified audio ID is playing; otherwise, false.

See Also

AudioController Class


IsPlaylistPlaying Method

AudioController..::..IsPlaylistPlaying Method
AudioController Class See Also Send Feedback
Determines whether the playlist is playing.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static bool IsPlaylistPlaying()

Return Value

true if the current music track is from the playlist; otherwise, false.

See Also

AudioController Class


IsValidAudioID Method

AudioController..::..IsValidAudioID Method
AudioController Class See Also Send Feedback
Tests if a given audioID is valid.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static bool IsValidAudioID(
    string audioID
)

Parameters

audioID
Type: System..::..String
The audioID

Return Value

true if the audioID is valid

See Also

AudioController Class


NewCategory Method

AudioController..::..NewCategory Method
AudioController Class See Also Send Feedback
Creates a new audio category

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioCategory NewCategory(
    string categoryName
)

Parameters

categoryName
Type: System..::..String
Name of the category.

Return Value

Reference to the new category.

See Also

AudioController Class


PauseAll Method

AudioController..::..PauseAll Method
AudioController Class See Also Send Feedback
Pauses all playing audio items (including the music).

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static void PauseAll(
    float fadeOutLength
)

Parameters

fadeOutLength
Type: System..::..Single
The fade-out time [Default=0]

See Also

AudioController Class


PauseCategory Method

AudioController..::..PauseCategory Method
AudioController Class See Also Send Feedback
Pauses all playing audio items in the specified category (including the music).

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static void PauseCategory(
    string categoryName,
    float fadeOutLength
)

Parameters

categoryName
Type: System..::..String
Name of category.
fadeOutLength
Type: System..::..Single
The fade-out time [Default=0]

See Also

AudioController Class


PauseMusic Method

AudioController..::..PauseMusic Method
AudioController Class See Also Send Feedback
Pauses the currently playing music.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static bool PauseMusic(
    float fadeOut
)

Parameters

fadeOut
Type: System..::..Single
The fade-out time in seconds.

Return Value

true if any music was paused, otherwise false

See Also

AudioController Class


Play Method

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioController..::..Play Method
AudioController Class See Also Send Feedback

Overload List

Name | Description
Play(String) | Plays an audio item with the name audioID.
Play(String, Transform) | Plays an audio item with the name audioID parented to a specified transform.
Play(String, Vector3, Transform) | Plays an audio item with the name audioID parented to a specified transform with a world offset.
Play(String, Single, Single, Single) | Plays an audio item with the name audioID.
Play(String, Transform, Single, Single, Single) | Plays an audio item with the name audioID parented to a specified transform.
Play(String, Vector3, Transform, Single, Single, Single) | Plays an audio item with the name audioID parented to a specified transform with a world offset.

See Also

AudioController Class
AudioController Members


Play Method (String)

AudioController..::..Play Method (String)
AudioController Class See Also Send Feedback
Plays an audio item with the name audioID.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioObject Play(
    string audioID
)

Parameters

audioID
Type: System..::..String
The audio ID.

Return Value

Returns the reference of the AudioObject that is used to play the audio item, or null if the audioID does not exist. Warning: Use PoolableReference<(Of <(<'T>)>)> to store an AudioObject reference if you have pooling enabled.

Remarks

If "3D sound" is enabled in the audio import settings of the audio clip the object will be placed right in front of the current audio listener which is usually on the main camera. Note that the audio object will not be parented - so you will hear when the audio listener moves.

See Also

AudioController Class
Play Overload


Play Method (String, )

AudioController..::..Play Method (String, )
AudioController Class See Also Send Feedback
Plays an audio item with the name audioID parented to a specified transform.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioObject Play(
    string audioID,
    Transform parentObj
)

Parameters

audioID
Type: System..::..String
The audio ID.
parentObj
Type: Transform
The parent transform.

Return Value

Returns the reference of the AudioObject that is used to play the audio item, or null if the audioID does not exist.

Remarks

If the audio clip is marked as 3D the audio clip will be played at the position of the parent transform. As the audio object will get attached to the transform, it is important to destroy the parent object using the Destroy(GameObject) function, even if the parent object is not poolable itself

See Also

AudioController Class
Play Overload


Play Method (String, , )

AudioController..::..Play Method (String, , )
AudioController Class See Also Send Feedback
Plays an audio item with the name audioID parented to a specified transform with a world offset.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioObject Play(
    string audioID,
    Vector3 worldPosition,
    Transform parentObj
)

Parameters

audioID
Type: System..::..String
The audio ID.
worldPosition
Type: Vector3
The position in world coordinates.
parentObj
Type: Transform
The parent transform [default=null].

Return Value

Returns the reference of the AudioObject that is used to play the audio item, or null if the audioID does not exist.

Remarks

If the audio clip is marked as 3D the audio clip will be played at the position of the parent transform. As the audio object will get attached to the transform, it is important to destroy the parent object using the Destroy(GameObject) function, even if the parent object is not poolable itself

See Also

AudioController Class
Play Overload


Play Method (String, Single, Single, Single)

AudioController..::..Play Method (String, Single, Single, Single)
AudioController Class See Also Send Feedback
Plays an audio item with the name audioID.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioObject Play(
    string audioID,
    float volume,
    float delay,
    float startTime
)

Parameters

audioID
Type: System..::..String
The audio ID.
volume
Type: System..::..Single
The volume between 0 and 1 [default=1].
delay
Type: System..::..Single
The delay [default=0].
startTime
Type: System..::..Single
The start time [default=0]

Return Value

Returns the reference of the AudioObject that is used to play the audio item, or null if the audioID does not exist. Warning: Use PoolableReference<(Of <(<'T>)>)> to store an AudioObject reference if you have pooling enabled.

Remarks

If "3D sound" is enabled in the audio import settings of the audio clip the object will be placed right in front of the current audio listener which is usually on the main camera. Note that the audio object will not be parented - so you will hear when the audio listener moves.

See Also

AudioController Class
Play Overload


Play Method (String, , Single, Single, Single)

AudioController..::..Play Method (String, , Single, Single, Single)
AudioController Class See Also Send Feedback
Plays an audio item with the name audioID parented to a specified transform.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioObject Play(
    string audioID,
    Transform parentObj,
    float volume,
    float delay,
    float startTime
)

Parameters

audioID
Type: System..::..String
The audio ID.
parentObj
Type: Transform
The parent transform.
volume
Type: System..::..Single
The volume between 0 and 1 [default=1].
delay
Type: System..::..Single
The delay [default=0].
startTime
Type: System..::..Single
The start time [default=0]

Return Value

Returns the reference of the AudioObject that is used to play the audio item, or null if the audioID does not exist.

Remarks

If the audio clip is marked as 3D the audio clip will be played at the position of the parent transform. As the audio object will get attached to the transform, it is important to destroy the parent object using the Destroy(GameObject) function, even if the parent object is not poolable itself

See Also

AudioController Class
Play Overload


Play Method (String, , , Single, Single, Single)

AudioController..::..Play Method (String, , , Single, Single, Single)
AudioController Class See Also Send Feedback
Plays an audio item with the name audioID parented to a specified transform with a world offset.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioObject Play(
    string audioID,
    Vector3 worldPosition,
    Transform parentObj,
    float volume,
    float delay,
    float startTime
)

Parameters

audioID
Type: System..::..String
The audio ID.
worldPosition
Type: Vector3
The position in world coordinates.
parentObj
Type: Transform
The parent transform.
volume
Type: System..::..Single
The volume between 0 and 1 [default=1].
delay
Type: System..::..Single
The delay [default=0].
startTime
Type: System..::..Single
The start time [default=0]

Return Value

Returns the reference of the AudioObject that is used to play the audio item, or null if the audioID does not exist.

Remarks

If the audio clip is marked as 3D the audio clip will be played at the position of the parent transform. As the audio object will get attached to the transform, it is important to destroy the parent object using the Destroy(GameObject) function, even if the parent object is not poolable itself

See Also

AudioController Class
Play Overload


PlayAfter Method

AudioController..::..PlayAfter Method
AudioController Class See Also Send Feedback
Plays an audio item with the name audioID right after the given AudioObject stops playing. (see the Unity AudioSettings.dspTime documentation)

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioObject PlayAfter(
    string audioID,
    AudioObject playingAudio,
    double deltaDspTime,
    float volume,
    float startTime
)

Parameters

audioID
Type: System..::..String
The audio ID.
playingAudio
Type: (Default Namespace)..::..AudioObject
Playback will start after this AudioObject finished playing
deltaDspTime
Type: System..::..Double
A time delta (high precision DSP time) at which to start playing. Negative values will cause audios to overlap.
volume
Type: System..::..Single
The volume between 0 and 1 [default=1].
startTime
Type: System..::..Single
The start time seconds [default=0]

Return Value

Returns the reference of the AudioObject that is used to play the audio item, or null if the audioID does not exist.

Remarks

Uses the PlayScheduled function only available in Unity v4.1 or newer that allows to stitch two audios together at DSP level precision without a gap. Can not be used to chain more then one audio.

See Also

AudioController Class


PlayAudioItem Method

AudioController..::..PlayAudioItem Method
AudioController Class See Also Send Feedback
Plays a specific AudioItem.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioObject PlayAudioItem(
    AudioItem sndItem,
    float volume,
    Vector3 worldPosition,
    Transform parentObj,
    float delay,
    float startTime,
    bool playWithoutAudioObject,
    AudioObject useExistingAudioObj,
    double dspTime
)

Parameters

sndItem
Type: (Default Namespace)..::..AudioItem
the AudioItem
volume
Type: System..::..Single
the volume
worldPosition
Type: Vector3
the world position
parentObj
Type: Transform
the parent object, or null
delay
Type: System..::..Single
the delay in seconds
startTime
Type: System..::..Single
the start time seconds
playWithoutAudioObject
Type: System..::..Boolean
if trueplays the audio by using the Unity function PlayOneShot without creating an audio game object. Allows playing audios from within the Unity inspector.
useExistingAudioObj
Type: (Default Namespace)..::..AudioObject
if specified this existing audio object is used instead of creating a new AudioObject
dspTime
Type: System..::..Double
The high precision DSP time at which to schedule playing the audio [default=0]

Return Value

The created AudioObject or null

Remarks

This function is used by the editor extension and is normally not required for application developers. Use Play(String) instead.

See Also

AudioController Class


PlayAudioSubItem Method

AudioController..::..PlayAudioSubItem Method
AudioController Class See Also Send Feedback
Plays a specific AudioSubItem.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioObject PlayAudioSubItem(
    AudioSubItem subItem,
    float volume,
    Vector3 worldPosition,
    Transform parentObj,
    float delay,
    float startTime,
    bool playWithoutAudioObject,
    AudioObject useExistingAudioObj,
    double dspTime
)

Parameters

subItem
Type: (Default Namespace)..::..AudioSubItem
the AudioSubItem
volume
Type: System..::..Single
the volume
worldPosition
Type: Vector3
the world position
parentObj
Type: Transform
the parent object, or null
delay
Type: System..::..Single
the delay in seconds
startTime
Type: System..::..Single
the start time seconds
playWithoutAudioObject
Type: System..::..Boolean
if trueplays the audio by using the Unity function PlayOneShot without creating an audio game object. Allows playing audios from within the Unity inspector.
useExistingAudioObj
Type: (Default Namespace)..::..AudioObject
if specified this existing audio object is used instead of creating a new AudioObject
dspTime
Type: System..::..Double
The high precision DSP time at which to schedule playing the audio [default=0]

Return Value

The created AudioObject or null

Remarks

This function is used by the editor extension and is normally not required for application developers. Use Play(String) instead.

See Also

AudioController Class


PlayMusic Method

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioController..::..PlayMusic Method
AudioController Class See Also Send Feedback

Overload List

Name | Description
PlayMusic(String) | Plays an audio item with the name audioID as music.
PlayMusic(String, Single) | Plays an audio item with the name audioID as music.
PlayMusic(String, Single, Single, Single) | Plays an audio item with the name audioID as music.
PlayMusic(String, Transform, Single, Single, Single) | Plays an audio item with the name audioID as music at the specified position.
PlayMusic(String, Vector3, Transform, Single, Single, Single) | Plays an audio item with the name audioID as music at the specified position.

See Also

AudioController Class
AudioController Members


PlayMusic Method (String)

AudioController..::..PlayMusic Method (String)
AudioController Class See Also Send Feedback
Plays an audio item with the name audioID as music.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioObject PlayMusic(
    string audioID
)

Parameters

audioID
Type: System..::..String
The audio ID.

Return Value

Returns the reference of the AudioObject that is used to play the audio item, or null if the audioID does not exist. Warning: Use PoolableReference<(Of <(<'T>)>)> to store an AudioObject reference if you have pooling enabled.

Remarks

Variant of PlayMusic(String, Single, Single, Single) with default parameters.

See Also

AudioController Class
PlayMusic Overload


PlayMusic Method (String, Single)

AudioController..::..PlayMusic Method (String, Single)
AudioController Class See Also Send Feedback
Plays an audio item with the name audioID as music.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioObject PlayMusic(
    string audioID,
    float volume
)

Parameters

audioID
Type: System..::..String
The audio ID.
volume
Type: System..::..Single
The volume between 0 and 1 [default=1].

Return Value

Returns the reference of the AudioObject that is used to play the audio item, or null if the audioID does not exist. Warning: Use PoolableReference<(Of <(<'T>)>)> to store an AudioObject reference if you have pooling enabled.

Remarks

Variant of PlayMusic(String, Single, Single, Single) with default parameters.

See Also

AudioController Class
PlayMusic Overload


PlayMusic Method (String, Single, Single, Single)

AudioController..::..PlayMusic Method (String, Single, Single, Single)
AudioController Class See Also Send Feedback
Plays an audio item with the name audioID as music.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioObject PlayMusic(
    string audioID,
    float volume,
    float delay,
    float startTime
)

Parameters

audioID
Type: System..::..String
The audio ID.
volume
Type: System..::..Single
The volume betweeen 0 and 1 [default=1].
delay
Type: System..::..Single
The delay [default=0].
startTime
Type: System..::..Single
The start time [default=0]

Return Value

Returns the reference of the AudioObject that is used to play the audio item, or null if the audioID does not exist. Warning: Use PoolableReference<(Of <(<'T>)>)> to store an AudioObject reference if you have pooling enabled.

Remarks

PlayMusic makes sure that only one music track is played at a time. If music cross fading is enabled in the AudioController fading is performed automatically.
If "3D sound" is enabled in the audio import settings of the audio clip the object will be placed right in front of the current audio listener which is usually on the main camera. Note that the audio object will not be parented - so you will hear when the audio listener moves.

See Also

AudioController Class
PlayMusic Overload


PlayMusic Method (String, , Single, Single, Single)

AudioController..::..PlayMusic Method (String, , Single, Single, Single)
AudioController Class See Also Send Feedback
Plays an audio item with the name audioID as music at the specified position.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioObject PlayMusic(
    string audioID,
    Transform parentObj,
    float volume,
    float delay,
    float startTime
)

Parameters

audioID
Type: System..::..String
The audio ID.
parentObj
Type: Transform
The parent transform or null.
volume
Type: System..::..Single
The volume between 0 and 1 [default=1].
delay
Type: System..::..Single
The delay [default=0].
startTime
Type: System..::..Single
The start time [default=0]

Return Value

Returns the reference of the AudioObject that is used to play the audio item, or null if the audioID does not exist. Warning: Use PoolableReference<(Of <(<'T>)>)> to store an AudioObject reference if you have pooling enabled.

Remarks

PlayMusic makes sure that only one music track is played at a time. If music cross fading is enabled in the AudioController fading is performed automatically.

See Also

AudioController Class
PlayMusic Overload


PlayMusic Method (String, , , Single, Single, Single)

AudioController..::..PlayMusic Method (String, , , Single, Single, Single)
AudioController Class See Also Send Feedback
Plays an audio item with the name audioID as music at the specified position.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioObject PlayMusic(
    string audioID,
    Vector3 worldPosition,
    Transform parentObj,
    float volume,
    float delay,
    float startTime
)

Parameters

audioID
Type: System..::..String
The audio ID.
worldPosition
Type: Vector3
The position in world coordinates.
parentObj
Type: Transform
The parent transform or null.
volume
Type: System..::..Single
The volume between 0 and 1 [default=1].
delay
Type: System..::..Single
The delay [default=0].
startTime
Type: System..::..Single
The start time [default=0]

Return Value

Returns the reference of the AudioObject that is used to play the audio item, or null if the audioID does not exist. Warning: Use PoolableReference<(Of <(<'T>)>)> to store an AudioObject reference if you have pooling enabled.

Remarks

PlayMusic makes sure that only one music track is played at a time. If music cross fading is enabled in the AudioController fading is performed automatically.

See Also

AudioController Class
PlayMusic Overload


PlayMusicPlaylist Method

AudioController..::..PlayMusicPlaylist Method
AudioController Class See Also Send Feedback
Start playing the music playlist.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioObject PlayMusicPlaylist()

Return Value

The AudioObject of the current music, or null if no music track could be played.

See Also

AudioController Class


PlayNextMusicOnPlaylist Method

AudioController..::..PlayNextMusicOnPlaylist Method
AudioController Class See Also Send Feedback
Jumps to the next the music track on the playlist.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioObject PlayNextMusicOnPlaylist()

Return Value

The AudioObject of the current music, or null if no music track could be played.

Remarks

If shuffling is enabled it will jump to the next randomly chosen track.

See Also

AudioController Class


PlayPreviousMusicOnPlaylist Method

AudioController..::..PlayPreviousMusicOnPlaylist Method
AudioController Class See Also Send Feedback
Jumps to the previous music track on the playlist.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioObject PlayPreviousMusicOnPlaylist()

Return Value

The AudioObject of the current music, or null if no music track could be played.

Remarks

If shuffling is enabled it will jump to the previously played track.

See Also

AudioController Class


PlayScheduled Method

AudioController..::..PlayScheduled Method
AudioController Class See Also Send Feedback
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)

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioObject PlayScheduled(
    string audioID,
    double dspTime,
    Vector3 worldPosition,
    Transform parentObj,
    float volume,
    float startTime
)

Parameters

audioID
Type: System..::..String
The audio ID.
dspTime
Type: System..::..Double
The high precision DSP time at which to start playing.
worldPosition
Type: Vector3
The position in world coordinates.
parentObj
Type: Transform
The parent transform.
volume
Type: System..::..Single
The volume between 0 and 1 [default=1].
startTime
Type: System..::..Single
The start time seconds [default=0]

Return Value

Returns the reference of the AudioObject that is used to play the audio item, or null if the audioID does not exist.

See Also

AudioController Class


RemoveAudioItem Method

AudioController..::..RemoveAudioItem Method
AudioController Class See Also Send Feedback
Removes an AudioItem from the AudioController.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static bool RemoveAudioItem(
    string audioID
)

Parameters

audioID
Type: System..::..String
Name of the audio item to remove.

Return Value

true if the audio item was found and successfully removed, otherwise false

See Also

AudioController Class


RemoveCategory Method

AudioController..::..RemoveCategory Method
AudioController Class See Also Send Feedback
Removes an audio category.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static void RemoveCategory(
    string categoryName
)

Parameters

categoryName
Type: System..::..String
Name of the category to remove.

See Also

AudioController Class


SetCategoryVolume Method

AudioController..::..SetCategoryVolume Method
AudioController Class See Also Send Feedback
Changes the category volume. Also effects currently playing audio items.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static void SetCategoryVolume(
    string name,
    float volume
)

Parameters

name
Type: System..::..String
The category name.
volume
Type: System..::..Single
The volume (between 0 and 1).

See Also

AudioController Class


SetGlobalVolume Method

AudioController..::..SetGlobalVolume Method
AudioController Class See Also Send Feedback
Changes the global volume. Effects all currently playing audio items.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static void SetGlobalVolume(
    float volume
)

Parameters

volume
Type: System..::..Single
The volume (between 0 and 1).

Remarks

Volume change is also applied to all additional AudioControllers.

See Also

AudioController Class


SetMusicPlaylist Method

AudioController..::..SetMusicPlaylist Method
AudioController Class See Also Send Feedback
Sets the current playlist to the specified audioID array

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static void SetMusicPlaylist(
    string[] playlist
)

Parameters

playlist
Type: array< System..::..String >[]()[][]
The new playlist array

See Also

AudioController Class


Stop Method

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioController..::..Stop Method
AudioController Class See Also Send Feedback

Overload List

Name | Description
Stop(String) | Stops all playing audio items with name audioID.
Stop(String, Single) | Stops all playing audio items with name audioID with a fade-out.

See Also

AudioController Class
AudioController Members


Stop Method (String)

AudioController..::..Stop Method (String)
AudioController Class See Also Send Feedback
Stops all playing audio items with name audioID.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static bool Stop(
    string audioID
)

Parameters

audioID
Type: System..::..String
The audio ID.

Return Value

Return true if any audio was stopped.

See Also

AudioController Class
Stop Overload


Stop Method (String, Single)

AudioController..::..Stop Method (String, Single)
AudioController Class See Also Send Feedback
Stops all playing audio items with name audioID with a fade-out.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static bool Stop(
    string audioID,
    float fadeOutLength
)

Parameters

audioID
Type: System..::..String
The audio ID.
fadeOutLength
Type: System..::..Single
The fade out time. If a negative value is specified, the subitem's FadeOut value is taken.

Return Value

Return true if any audio was stopped.

See Also

AudioController Class
Stop Overload


StopAll Method

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioController..::..StopAll Method
AudioController Class See Also Send Feedback

Overload List

Name | Description
StopAll()()()() | Immediately stops playing audio items (including the music).
StopAll(Single) | Fades out all playing audio items (including the music).

See Also

AudioController Class
AudioController Members


StopAll Method

AudioController..::..StopAll Method
AudioController Class See Also Send Feedback
Immediately stops playing audio items (including the music).

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static void StopAll()

See Also

AudioController Class
StopAll Overload


StopAll Method (Single)

AudioController..::..StopAll Method (Single)
AudioController Class See Also Send Feedback
Fades out all playing audio items (including the music).

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static void StopAll(
    float fadeOutLength
)

Parameters

fadeOutLength
Type: System..::..Single
The fade out time. If a negative value is specified, the subitem's FadeOut value is taken.

See Also

AudioController Class
StopAll Overload


StopMusic Method

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioController..::..StopMusic Method
AudioController Class See Also Send Feedback

Overload List

Name | Description
StopMusic()()()() | Stops the currently playing music.
StopMusic(Single) | Stops the currently playing music with fade-out.

See Also

AudioController Class
AudioController Members


StopMusic Method

AudioController..::..StopMusic Method
AudioController Class See Also Send Feedback
Stops the currently playing music.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static bool StopMusic()

Return Value

true if any music was stopped, otherwise false

See Also

AudioController Class
StopMusic Overload


StopMusic Method (Single)

AudioController..::..StopMusic Method (Single)
AudioController Class See Also Send Feedback
Stops the currently playing music with fade-out.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static bool StopMusic(
    float fadeOut
)

Parameters

fadeOut
Type: System..::..Single
The fade-out time in seconds.

Return Value

true if any music was stopped, otherwise false

See Also

AudioController Class
StopMusic Overload


UnloadAllAudioClips Method

AudioController..::..UnloadAllAudioClips Method
AudioController Class See Also Send Feedback
Unloads all AudioClips specified in this AudioController from memory.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void UnloadAllAudioClips()

Remarks

You will still be able to play the AudioClips, but you may experience performance hickups when Unity reloads the audio asset

See Also

AudioController Class


UnpauseAll Method

AudioController..::..UnpauseAll Method
AudioController Class See Also Send Feedback
Un-pauses all playing audio items (including the music).

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static void UnpauseAll(
    float fadeInLength
)

Parameters

fadeInLength
Type: System..::..Single
The fade-in time [Default=0]

See Also

AudioController Class


UnpauseCategory Method

AudioController..::..UnpauseCategory Method
AudioController Class See Also Send Feedback
Un-pauses all playing audio items in the specified category (including the music).

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static void UnpauseCategory(
    string categoryName,
    float fadeInLength
)

Parameters

categoryName
Type: System..::..String
Name of category.
fadeInLength
Type: System..::..Single
The fade-in time [Default=0]

See Also

AudioController Class


UnpauseMusic Method

AudioController..::..UnpauseMusic Method
AudioController Class See Also Send Feedback
Unpauses the current music.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static bool UnpauseMusic(
    float fadeIn
)

Parameters

fadeIn
Type: System..::..Single
The fade-in time in seconds.

Return Value

true if any music was unpaused, otherwise false

See Also

AudioController Class


AudioController Properties

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioController Properties
AudioController Class See Also Send Feedback

The AudioController type exposes the following members.

Properties

 | Name | Description
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.
 | systemDeltaTime | Returns the high precision audio system delta time since the last frame update.
 | 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

AudioController Class


DisableAudio Property

AudioController..::..DisableAudio Property
AudioController Class See Also Send Feedback
Disables all audio playback.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool DisableAudio { get; set; }

Remarks

Does not stop currently playing audios. Call StopAll()()()() to stop all currently playing.

See Also

AudioController Class


isAdditionalAudioController Property

AudioController..::..isAdditionalAudioController Property
AudioController Class See Also Send Feedback
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.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool isAdditionalAudioController { get; set; }

Remarks

This can be used for games with a large amount of audio where you don't want all audio to be in memory at all time. In this case use a persistent main AudioController for audios shared between all scenes of your game, and additional AudioControllers for each scene containing specific audio for this level.

See Also

AudioController Class


isSingletonObject Property

AudioController..::..isSingletonObject Property
AudioController Class See Also Send Feedback
returns true if the AudioController is the main controller (not an additional controller)

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public override bool isSingletonObject { get; }

See Also

AudioController Class


musicCrossFadeTime_In Property

AudioController..::..musicCrossFadeTime_In Property
AudioController Class See Also Send Feedback
Specifies a specific fade-in time for music cross fading. Only meaningful if specifyCrossFadeInAndOutSeperately is enabled.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float musicCrossFadeTime_In { get; set; }

See Also

AudioController Class


musicCrossFadeTime_Out Property

AudioController..::..musicCrossFadeTime_Out Property
AudioController Class See Also Send Feedback
Specifies a specific fade-out time for music cross fading. Only meaningful if specifyCrossFadeInAndOutSeperately is enabled.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float musicCrossFadeTime_Out { get; set; }

See Also

AudioController Class


musicEnabled Property

AudioController..::..musicEnabled Property
AudioController Class See Also Send Feedback
Gets or sets the musicEnabled.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool musicEnabled { get; set; }

Field Value

true enables music; false disables music

See Also

AudioController Class


systemDeltaTime Property

AudioController..::..systemDeltaTime Property
AudioController Class See Also Send Feedback
Returns the high precision audio system delta time since the last frame update.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static double systemDeltaTime { get; }

See Also

AudioController Class


systemTime Property

AudioController..::..systemTime Property
AudioController Class See Also Send Feedback
Returns the high precision audio system time size the application launch.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static double systemTime { get; }

Remarks

The audio system time does not increase if the application is paused. For performance reasons the time only gets updated with the frame rate. However, the time value does not lose precision even if the application is running for a long time (unlike Unity's 32bit float Time.systemTime

See Also

AudioController Class


Volume Property

AudioController..::..Volume Property
AudioController Class See Also Send Feedback
The global volume applied to all categories. You change the volume by script and the change will be apply to all playing audios immediately.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float Volume { get; set; }

See Also

AudioController Class


AudioItem Class

AudioItem Class
Members See Also Send Feedback
The AudioItem class represents a uniquely named audio entity that can be played by scripts.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
[SerializableAttribute]
public class AudioItem

Remarks

AudioItem objects are defined in an AudioCategory using the Unity inspector.

Inheritance Hierarchy

System..::..Object
(Default Namespace)..::..AudioItem

See Also

AudioItem Members


AudioItem Members

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioItem Members
AudioItem Class Constructors Methods Fields Properties See Also Send Feedback

The AudioItem type exposes the following members.

Constructors

 | Name | Description
Public method | AudioItem | Initializes a new instance of the AudioItem class

Methods

 | Name | Description
Public method | UnloadAudioClip | Unloads the AudioClip from memory.

Fields

 | Name | Description
Public field | audioSource_MaxDistance | Overrides the AudioSource MaxDistance value if overrideAudioSourceSettings is enabled.
Public field | audioSource_MinDistance | Overrides the AudioSource MinDistance value if overrideAudioSourceSettings is enabled.
Public field | Delay | Defers the playback of the audio item for Delay seconds.
Public field | DestroyOnLoad | If disabled, the audio will keep on playing if a new scene is loaded.
Public field | Loop | If enabled the audio item will get looped when played.
Public field | loopSequenceCount | The number of sub-items to be played in the loop modes LoopSequence.
Public field | loopSequenceOverlap | Specifies a time overlap for the LoopSequence
Public field | loopSequenceRandomDelay | Specifies a random delay for the LoopSequence
Public field | MaxInstanceCount | Assures that the same audio item will not be played more than MaxInstanceCount times simultaneously.
Public field | MinTimeBetweenPlayCalls | Assures that the same audio item will not be played multiple times within this time frame. This is useful if several events triggered at almost the same time want to play the same audio item which can cause unwanted noise artifacts.
Public field | Name | The unique name of the audio item ( = audioID )
Public field | overrideAudioSourceSettings | If enabled you can specify specific AudioSource settings
Public field | SubItemPickMode | Determines which AudioSubItem is chosen when playing an AudioItem
Public field | subItems | Define your audio sub-items using the Unity inspector.
Public field | Volume | The volume applied to all audio sub-items of this audio item.

Properties

 | Name | Description
Public property | category | the AudioCategroy the audio item belongs to.

See Also

AudioItem Class


AudioItem Constructor

AudioItem Constructor
AudioItem Class See Also Send Feedback
Initializes a new instance of the AudioItem class

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioItem()

See Also

AudioItem Class


AudioItem Fields

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioItem Fields
AudioItem Class See Also Send Feedback

The AudioItem type exposes the following members.

Fields

 | Name | Description
Public field | audioSource_MaxDistance | Overrides the AudioSource MaxDistance value if overrideAudioSourceSettings is enabled.
Public field | audioSource_MinDistance | Overrides the AudioSource MinDistance value if overrideAudioSourceSettings is enabled.
Public field | Delay | Defers the playback of the audio item for Delay seconds.
Public field | DestroyOnLoad | If disabled, the audio will keep on playing if a new scene is loaded.
Public field | Loop | If enabled the audio item will get looped when played.
Public field | loopSequenceCount | The number of sub-items to be played in the loop modes LoopSequence.
Public field | loopSequenceOverlap | Specifies a time overlap for the LoopSequence
Public field | loopSequenceRandomDelay | Specifies a random delay for the LoopSequence
Public field | MaxInstanceCount | Assures that the same audio item will not be played more than MaxInstanceCount times simultaneously.
Public field | MinTimeBetweenPlayCalls | Assures that the same audio item will not be played multiple times within this time frame. This is useful if several events triggered at almost the same time want to play the same audio item which can cause unwanted noise artifacts.
Public field | Name | The unique name of the audio item ( = audioID )
Public field | overrideAudioSourceSettings | If enabled you can specify specific AudioSource settings
Public field | SubItemPickMode | Determines which AudioSubItem is chosen when playing an AudioItem
Public field | subItems | Define your audio sub-items using the Unity inspector.
Public field | Volume | The volume applied to all audio sub-items of this audio item.

See Also

AudioItem Class


audioSource_MaxDistance Field

AudioItem..::..audioSource_MaxDistance Field
AudioItem Class See Also Send Feedback
Overrides the AudioSource MaxDistance value if overrideAudioSourceSettings is enabled.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float audioSource_MaxDistance

See Also

AudioItem Class


audioSource_MinDistance Field

AudioItem..::..audioSource_MinDistance Field
AudioItem Class See Also Send Feedback
Overrides the AudioSource MinDistance value if overrideAudioSourceSettings is enabled.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float audioSource_MinDistance

See Also

AudioItem Class


Delay Field

AudioItem..::..Delay Field
AudioItem Class See Also Send Feedback
Defers the playback of the audio item for Delay seconds.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float Delay

See Also

AudioItem Class


DestroyOnLoad Field

AudioItem..::..DestroyOnLoad Field
AudioItem Class See Also Send Feedback
If disabled, the audio will keep on playing if a new scene is loaded.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool DestroyOnLoad

See Also

AudioItem Class


Loop Field

AudioItem..::..Loop Field
AudioItem Class See Also Send Feedback
If enabled the audio item will get looped when played.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioItem..::..LoopMode Loop

See Also

AudioItem Class


loopSequenceCount Field

AudioItem..::..loopSequenceCount Field
AudioItem Class See Also Send Feedback
The number of sub-items to be played in the loop modes LoopSequence.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public int loopSequenceCount

Remarks

Specify 0 to loop infinitely (This is also the default value). In PlaySequenceAndLoopLast mode as many sub-item will be picked as there are sub-items specified for this audio item.

See Also

AudioItem Class


loopSequenceOverlap Field

AudioItem..::..loopSequenceOverlap Field
AudioItem Class See Also Send Feedback
Specifies a time overlap for the LoopSequence

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float loopSequenceOverlap

Remarks

Positive values mean an overlap, negative values mean a gap between two consequent sub-items in the loop sequence.

See Also

AudioItem Class


loopSequenceRandomDelay Field

AudioItem..::..loopSequenceRandomDelay Field
AudioItem Class See Also Send Feedback
Specifies a random delay for the LoopSequence

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float loopSequenceRandomDelay

Remarks

A random delay between 0 and this value will be added between two subsequent subitmes in the LoopSequence. Can be combined with loopSequenceOverlap.

See Also

AudioItem Class


MaxInstanceCount Field

AudioItem..::..MaxInstanceCount Field
AudioItem Class See Also Send Feedback
Assures that the same audio item will not be played more than MaxInstanceCount times simultaneously.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public int MaxInstanceCount

Remarks

Set to 0 to disable.

See Also

AudioItem Class


MinTimeBetweenPlayCalls Field

AudioItem..::..MinTimeBetweenPlayCalls Field
AudioItem Class See Also Send Feedback
Assures that the same audio item will not be played multiple times within this time frame. This is useful if several events triggered at almost the same time want to play the same audio item which can cause unwanted noise artifacts.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float MinTimeBetweenPlayCalls

See Also

AudioItem Class


Name Field

AudioItem..::..Name Field
AudioItem Class See Also Send Feedback
The unique name of the audio item ( = audioID )

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public string Name

See Also

AudioItem Class


overrideAudioSourceSettings Field

AudioItem..::..overrideAudioSourceSettings Field
AudioItem Class See Also Send Feedback
If enabled you can specify specific AudioSource settings

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool overrideAudioSourceSettings

See Also

AudioItem Class


SubItemPickMode Field

AudioItem..::..SubItemPickMode Field
AudioItem Class See Also Send Feedback
Determines which AudioSubItem is chosen when playing an AudioItem

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioPickSubItemMode SubItemPickMode

See Also

AudioItem Class


subItems Field

AudioItem..::..subItems Field
AudioItem Class See Also Send Feedback
Define your audio sub-items using the Unity inspector.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioSubItem[] subItems

See Also

AudioItem Class


Volume Field

AudioItem..::..Volume Field
AudioItem Class See Also Send Feedback
The volume applied to all audio sub-items of this audio item.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float Volume

See Also

AudioItem Class


AudioItem Methods

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioItem Methods
AudioItem Class See Also Send Feedback

The AudioItem type exposes the following members.

Methods

 | Name | Description
Public method | UnloadAudioClip | Unloads the AudioClip from memory.

See Also

AudioItem Class


UnloadAudioClip Method

AudioItem..::..UnloadAudioClip Method
AudioItem Class See Also Send Feedback
Unloads the AudioClip from memory.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void UnloadAudioClip()

Remarks

You will still be able to play the AudioClip, but you may experience performance hickups when Unity reloads the audio asset

See Also

AudioItem Class


AudioItem Properties

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioItem Properties
AudioItem Class See Also Send Feedback

The AudioItem type exposes the following members.

Properties

 | Name | Description
Public property | category | the AudioCategroy the audio item belongs to.

See Also

AudioItem Class


category Property

AudioItem..::..category Property
AudioItem Class See Also Send Feedback
the AudioCategroy the audio item belongs to.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioCategory category { get; private set; }

See Also

AudioItem Class


AudioItem.LoopMode Enumeration

AudioItem..::..LoopMode Enumeration
AudioItem Class See Also Send Feedback
AudioItem loop mode.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
[SerializableAttribute]
public enum LoopMode

Members

Member name | Value | Description
DoNotLoop | 0 | No looping.
LoopSubitem | 1 | The chosen subitem (in dependence of the SubItemPickMode will be looped.
LoopSequence | 2 | After the subitem chosen in dependence of the SubItemPickMode has stopped playing, a new subitem will be chosen and played.
PlaySequenceAndLoopLast | 4 | Play as many sub-items as specified by loopSequenceCount and loop the last one picked. Specify zero to play as many sub-items as specified in this audio item.
IntroLoopOutroSequence | 5 | Play as many sub-items as specified by loopSequenceCount (as intro) and loop the second last one picked. If see AudioItem.Stop() is called the very last ist played as an outro.

See Also

(Default Namespace) Namespace

Send comments on this topic to ClockStone Support Email

Copyright (c) 2012 by ClockStone Software GmbH


AudioObject Class

AudioObject Class
Members Example See Also Send Feedback
The object playing the audio clip associated with a AudioSubItem

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public class AudioObject : RegisteredComponent

Remarks

If audio object pooling is enabled make sure you store references to an AudioObject by using PoolableReference<(Of <(<'T>)>)>

Examples

CopyC#
var soundFX = new PoolableReference<AudioObject>( AudioController.Play( "someSFX" ) );

// some other part of the code executed later when the sound may have stopped playing
// and was moved back to the pool
AudioObject audioObject = soundFX.Get();
if( audioObject != null )
{
    // it is safe to access audioObject here
    audioObject.Stop();
}

Inheritance Hierarchy

System..::..Object
Object
Component
Behaviour
MonoBehaviour
(Default Namespace)..::..RegisteredComponent
(Default Namespace)..::..AudioObject

See Also

AudioObject Members


AudioObject Members

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioObject Members
AudioObject Class Constructors Methods Properties See Also Send Feedback

The AudioObject type exposes the following members.

Constructors

 | Name | Description
Public method | AudioObject | Initializes a new instance of the AudioObject class

Methods

Name Description
Public method DestroyAudioObject
Destroys the audio object (using ObjectPoolController if pooling is enabled)
Public method DoesBelongToCategory
Checks if this AudioObject belongs to a specific category
Public method FadeIn
Fades-in a playing audio.
Public method FadeOut(Single)
Starts a fade-out. If the AudioItem mode is is a sequence, the next sub-item will continue to play after the this sub-item is completely faded out.
Public method FadeOut(Single, Single)
Starts a fade-out at a specified time. If the AudioItem mode is is a sequence, the next sub-item will continue to play after the this sub-item is completely faded out.
Public method FinishSequence
Finishes a playing sequence, depending on the AudioItem's loop mode :
  • LoopSequence: The sequence will stop after the current item has finished playing
  • PlaySequenceAndLoopLast: The sequence will stop after the current item has finished playing. If the sequence is during the looping part the looping will stop after the current loop reached its end.
  • IntroLoopOutroSequence: The sequence will stop after the current item has finished playing. If the sequence is during the looping part the outro will be played and the sequence will stop afterwards.
InverseTransformPitch
Inverse pitch transformation: TransformPitch(Single)
InverseTransformVolume
Inverse volume transformation TransformVolume(Single)
Public method IsPaused
Determines whether the audio clip is paused.
Public method IsPlaying
Determines if either the primary or the secondary audio clip is playing.
Public method IsPrimaryPlaying
Determines if the primary audio clip is playing.
Public method IsSecondaryPlaying
Determines if the secondary audio clip is playing.
Public method Pause()()()()
Pauses the audio clip.
Public method Pause(Single)
Pauses the audio clip with a fade-out.
Public method Play
Plays the audio clip with the specified delay.
Public method PlayAfter
Plays the specified audio after the current has finished playing
Public method PlayNow
Plays the specified audio.
Public method PlayScheduled
Plays the audio clip at the specified high precision DSP time (see the Unity AudioSettings.dspTime documentation)
Public method Stop()()()()
Stops playing this instance.
Public method Stop(Single)
Stops a playing audio with fade-out.
Public method Stop(Single, Single)
Stops a playing audio with fade-out at a specified time.
Public method SwitchAudioSources
Switches the primary and secondary audio source
TransformPitch
Transforms the pitch from semitones to a multiplicative factor
TransformVolume
Transforms the volume to make it perceptually more intuitive to scale and cross-fade.
Public method Unpause()()()()
Unpauses the audio clip.
Public method Unpause(Single)
Unpauses the audio clip with a fade-in.

Properties

 | Name | Description
Public property | audioID | Gets the audio ID.
Public property | audioItem | Gets the corresponding AudioSubItem
Public property | audioObjectTime | Returns the high precision local time of this audio object
Public property | audioTime | Sets or gets the current audio time relative to ClipStartTime
Public property | category | Gets the category.
Public property | clipLength | Gets the length of the clip.
Public property | completelyPlayedDelegate | Gets or sets the delegate to be called once an audio clip was completely played.
Public property | isFadingIn | return true if the audio is currently fading in
Public property | isFadingOut | return true if the audio is currently fading out
Public property | pan | Sets or gets the audio pan.
Public property | pitch | Sets or gets the audio pitch.
Public property | playCalledAtTime | Gets the systemTime at which the audio Play() function was called.
Public property | primaryAudioSource | returns the primary AudioSource
Public property | scheduledPlayingAtDspTime | Gets or sets the DSP time at which the audio is scheduled to play.
Public property | secondaryAudioSource | returns the secondary AudioSource
Public property | startedPlayingAtTime | Gets the systemTime at which the audio started playing.
Public property | stopAfterFadeOut | If enabled, the audio will stop plaing if a fadeout is finished.
Public property | subItem | Gets the corresponding AudioSubItem
Public property | timeUntilEnd | Gets the time until the clip will stop.
Public property | volume | Gets or sets the volume.
Public property | volumeItem | Gets or sets the volume of the audio item.
Public property | volumeTotal | Gets the total volume.
Public property | volumeTotalWithoutFade | Gets the total volume.

See Also

AudioObject Class


AudioObject Constructor

AudioObject Constructor
AudioObject Class See Also Send Feedback
Initializes a new instance of the AudioObject class

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioObject()

See Also

AudioObject Class


AudioObject Methods

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioObject Methods
AudioObject Class See Also Send Feedback

The AudioObject type exposes the following members.

Methods

Name Description
Public method DestroyAudioObject
Destroys the audio object (using ObjectPoolController if pooling is enabled)
Public method DoesBelongToCategory
Checks if this AudioObject belongs to a specific category
Public method FadeIn
Fades-in a playing audio.
Public method FadeOut(Single)
Starts a fade-out. If the AudioItem mode is is a sequence, the next sub-item will continue to play after the this sub-item is completely faded out.
Public method FadeOut(Single, Single)
Starts a fade-out at a specified time. If the AudioItem mode is is a sequence, the next sub-item will continue to play after the this sub-item is completely faded out.
Public method FinishSequence
Finishes a playing sequence, depending on the AudioItem's loop mode :
  • LoopSequence: The sequence will stop after the current item has finished playing
  • PlaySequenceAndLoopLast: The sequence will stop after the current item has finished playing. If the sequence is during the looping part the looping will stop after the current loop reached its end.
  • IntroLoopOutroSequence: The sequence will stop after the current item has finished playing. If the sequence is during the looping part the outro will be played and the sequence will stop afterwards.
InverseTransformPitch
Inverse pitch transformation: TransformPitch(Single)
InverseTransformVolume
Inverse volume transformation TransformVolume(Single)
Public method IsPaused
Determines whether the audio clip is paused.
Public method IsPlaying
Determines if either the primary or the secondary audio clip is playing.
Public method IsPrimaryPlaying
Determines if the primary audio clip is playing.
Public method IsSecondaryPlaying
Determines if the secondary audio clip is playing.
Public method Pause()()()()
Pauses the audio clip.
Public method Pause(Single)
Pauses the audio clip with a fade-out.
Public method Play
Plays the audio clip with the specified delay.
Public method PlayAfter
Plays the specified audio after the current has finished playing
Public method PlayNow
Plays the specified audio.
Public method PlayScheduled
Plays the audio clip at the specified high precision DSP time (see the Unity AudioSettings.dspTime documentation)
Public method Stop()()()()
Stops playing this instance.
Public method Stop(Single)
Stops a playing audio with fade-out.
Public method Stop(Single, Single)
Stops a playing audio with fade-out at a specified time.
Public method SwitchAudioSources
Switches the primary and secondary audio source
TransformPitch
Transforms the pitch from semitones to a multiplicative factor
TransformVolume
Transforms the volume to make it perceptually more intuitive to scale and cross-fade.
Public method Unpause()()()()
Unpauses the audio clip.
Public method Unpause(Single)
Unpauses the audio clip with a fade-in.

See Also

AudioObject Class


DestroyAudioObject Method

AudioObject..::..DestroyAudioObject Method
AudioObject Class See Also Send Feedback
Destroys the audio object (using ObjectPoolController if pooling is enabled)

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void DestroyAudioObject()

See Also

AudioObject Class


DoesBelongToCategory Method

AudioObject..::..DoesBelongToCategory Method
AudioObject Class See Also Send Feedback
Checks if this AudioObject belongs to a specific category

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool DoesBelongToCategory(
    string categoryName
)

Parameters

categoryName
Type: System..::..String
The name of the category

Return Value

true if the category with the specified name or one of its child categories contains the AudioItem the AudioObject belongs to.

See Also

AudioObject Class


FadeIn Method

AudioObject..::..FadeIn Method
AudioObject Class See Also Send Feedback
Fades-in a playing audio.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void FadeIn(
    float fadeInTime
)

Parameters

fadeInTime
Type: System..::..Single
The fade time in seconds.

See Also

AudioObject Class


FadeOut Method

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioObject..::..FadeOut Method
AudioObject Class See Also Send Feedback

Overload List

 | Name | Description
Public method | FadeOut(Single) | Starts a fade-out. If the AudioItem mode is is a sequence, the next sub-item will continue to play after the this sub-item is completely faded out.
Public method | FadeOut(Single, Single) | Starts a fade-out at a specified time. If the AudioItem mode is is a sequence, the next sub-item will continue to play after the this sub-item is completely faded out.

See Also

AudioObject Class
AudioObject Members


FadeOut Method (Single)

AudioObject..::..FadeOut Method (Single)
AudioObject Class See Also Send Feedback
Starts a fade-out. If the AudioItem mode is is a sequence, the next sub-item will continue to play after the this sub-item is completely faded out.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void FadeOut(
    float fadeOutLength
)

Parameters

fadeOutLength
Type: System..::..Single
The fade time in seconds. If a negative value is specified, the fade out as specified in the corresponding FadeOut is used

Remarks

If the audio is already fading out the requested fade-out is combined with the existing one. This function only fades-out the primary audio source.

See Also

AudioObject Class
FadeOut Overload


FadeOut Method (Single, Single)

AudioObject..::..FadeOut Method (Single, Single)
AudioObject Class See Also Send Feedback
Starts a fade-out at a specified time. If the AudioItem mode is is a sequence, the next sub-item will continue to play after the this sub-item is completely faded out.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void FadeOut(
    float fadeOutLength,
    float startToFadeTime
)

Parameters

fadeOutLength
Type: System..::..Single
The fade time in seconds. If a negative value is specified, the fade out as specified in the corresponding FadeOut is used
startToFadeTime
Type: System..::..Single
Fade out starts after startToFadeTime seconds have passed

Remarks

If the audio is already fading out the requested fade-out is combined with the existing one. This function only fades-out the primary audio source.

See Also

AudioObject Class
FadeOut Overload


FinishSequence Method

AudioObject..::..FinishSequence Method
AudioObject Class See Also Send Feedback
Finishes a playing sequence, depending on the AudioItem's loop mode :
  • LoopSequence: The sequence will stop after the current item has finished playing
  • PlaySequenceAndLoopLast: The sequence will stop after the current item has finished playing. If the sequence is during the looping part the looping will stop after the current loop reached its end.
  • IntroLoopOutroSequence: The sequence will stop after the current item has finished playing. If the sequence is during the looping part the outro will be played and the sequence will stop afterwards.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void FinishSequence()

Remarks

Has no effect if the audio is not in a sequence loop mode.

See Also

AudioObject Class
(Default Namespace) Namespace
(Default Namespace)..::..AudioItem..::..LoopMode


InverseTransformPitch Method

AudioObject..::..InverseTransformPitch Method
AudioObject Class See Also Send Feedback
Inverse pitch transformation: TransformPitch(Single)

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static float InverseTransformPitch(
    float pitch
)

Parameters

pitch
Type: System..::..Single
The transformed pitch

Return Value

The pitch shift in semitones

See Also

AudioObject Class


InverseTransformVolume Method

AudioObject..::..InverseTransformVolume Method
AudioObject Class See Also Send Feedback
Inverse volume transformation TransformVolume(Single)

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static float InverseTransformVolume(
    float volume
)

Parameters

volume
Type: System..::..Single
The volume to inverse-transform.

Return Value

The inverse-transformed volume

See Also

AudioObject Class


IsPaused Method

AudioObject..::..IsPaused Method
AudioObject Class See Also Send Feedback
Determines whether the audio clip is paused.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool IsPaused(
    bool returnTrueIfStillFadingOut
)

Parameters

returnTrueIfStillFadingOut
Type: System..::..Boolean
If true the fuction will return true even if the item is still fading out due to a Pause request with a fade-out.

Return Value

true if paused; otherwise, false.

See Also

AudioObject Class


IsPlaying Method

AudioObject..::..IsPlaying Method
AudioObject Class See Also Send Feedback
Determines if either the primary or the secondary audio clip is playing.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool IsPlaying()

Return Value

true if the audio clip is playing; otherwise, false.

See Also

AudioObject Class


IsPrimaryPlaying Method

AudioObject..::..IsPrimaryPlaying Method
AudioObject Class See Also Send Feedback
Determines if the primary audio clip is playing.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool IsPrimaryPlaying()

Return Value

true if the audio clip is playing; otherwise, false.

See Also

AudioObject Class


IsSecondaryPlaying Method

AudioObject..::..IsSecondaryPlaying Method
AudioObject Class See Also Send Feedback
Determines if the secondary audio clip is playing.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool IsSecondaryPlaying()

Return Value

true if the audio clip is playing; otherwise, false.

See Also

AudioObject Class


Pause Method

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioObject..::..Pause Method
AudioObject Class See Also Send Feedback

Overload List

 | Name | Description
Public method | Pause()()()() | Pauses the audio clip.
Public method | Pause(Single) | Pauses the audio clip with a fade-out.

See Also

AudioObject Class
AudioObject Members


Pause Method

AudioObject..::..Pause Method
AudioObject Class See Also Send Feedback
Pauses the audio clip.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void Pause()

See Also

AudioObject Class
Pause Overload


Pause Method (Single)

AudioObject..::..Pause Method (Single)
AudioObject Class See Also Send Feedback
Pauses the audio clip with a fade-out.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void Pause(
    float fadeOutTime
)

Parameters

fadeOutTime
Type: System..::..Single
The fade-out time in seconds.

See Also

AudioObject Class
Pause Overload


Play Method

AudioObject..::..Play Method
AudioObject Class See Also Send Feedback
Plays the audio clip with the specified delay.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void Play(
    float delay
)

Parameters

delay
Type: System..::..Single
The delay [Default=0].

See Also

AudioObject Class


PlayAfter Method

AudioObject..::..PlayAfter Method
AudioObject Class See Also Send Feedback
Plays the specified audio after the current has finished playing

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void PlayAfter(
    string audioID,
    double deltaDspTime,
    float volume,
    float startTime
)

Parameters

audioID
Type: System..::..String
The audioID to be played.
deltaDspTime
Type: System..::..Double
Optional delta time (high precsion DSP time), Default = 0.
volume
Type: System..::..Single
The volume [Default = 0].
startTime
Type: System..::..Single
The start time [Default = 0].

See Also

AudioObject Class


PlayNow Method

AudioObject..::..PlayNow Method
AudioObject Class See Also Send Feedback
Plays the specified audio.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void PlayNow(
    string audioID,
    float delay,
    float volume,
    float startTime
)

Parameters

audioID
Type: System..::..String
The audioID to be played.
delay
Type: System..::..Single
Start playing after this amount of seconds [Default = 0].
volume
Type: System..::..Single
The volume [Default = 0].
startTime
Type: System..::..Single
The start time [Default = 0].

Remarks

Does not stop the secondary audio source (if playing). See SwitchAudioSources()()()().

See Also

AudioObject Class


PlayScheduled Method

AudioObject..::..PlayScheduled Method
AudioObject Class See Also Send Feedback
Plays the audio clip at the specified high precision DSP time (see the Unity AudioSettings.dspTime documentation)

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void PlayScheduled(
    double dspTime
)

Parameters

dspTime
Type: System..::..Double
The high precision DSP time.

See Also

AudioObject Class


Stop Method

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioObject..::..Stop Method
AudioObject Class See Also Send Feedback

Overload List

 | Name | Description
Public method | Stop()()()() | Stops playing this instance.
Public method | Stop(Single) | Stops a playing audio with fade-out.
Public method | Stop(Single, Single) | Stops a playing audio with fade-out at a specified time.

See Also

AudioObject Class
AudioObject Members


Stop Method

AudioObject..::..Stop Method
AudioObject Class See Also Send Feedback
Stops playing this instance.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void Stop()

Remarks

Uses fade out as specified in the corresponding FadeOut.

See Also

AudioObject Class
Stop Overload


Stop Method (Single)

AudioObject..::..Stop Method (Single)
AudioObject Class See Also Send Feedback
Stops a playing audio with fade-out.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void Stop(
    float fadeOutLength
)

Parameters

fadeOutLength
Type: System..::..Single
The fade time in seconds. If a negative value is specified, the fade out as specified in the corresponding FadeOut is used

See Also

AudioObject Class
Stop Overload


Stop Method (Single, Single)

AudioObject..::..Stop Method (Single, Single)
AudioObject Class See Also Send Feedback
Stops a playing audio with fade-out at a specified time.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void Stop(
    float fadeOutLength,
    float startToFadeTime
)

Parameters

fadeOutLength
Type: System..::..Single
The fade time in seconds. If a negative value is specified, the fade out as specified in the corresponding FadeOut is used
startToFadeTime
Type: System..::..Single
Fade out starts after startToFadeTime seconds have passed

Remarks

If the audio is already fading out the requested fade-out is combined with the existing one.

See Also

AudioObject Class
Stop Overload


SwitchAudioSources Method

AudioObject..::..SwitchAudioSources Method
AudioObject Class Example See Also Send Feedback
Switches the primary and secondary audio source

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void SwitchAudioSources()

Remarks

This way a single AudioObject can play two audio clips at the same time. You can use it e.g. to cross fade between two audios using the same AudioObject.

Examples

playingAudioObject.FadeOut( 3 );
playingAudioObject.SwitchAudioSources();
playingAudioObject.PlayNow( "otherAudioID" );
playingAudioObject.FadeIn( 3 );

See Also

AudioObject Class


TransformPitch Method

AudioObject..::..TransformPitch Method
AudioObject Class See Also Send Feedback
Transforms the pitch from semitones to a multiplicative factor

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static float TransformPitch(
    float pitchSemiTones
)

Parameters

pitchSemiTones
Type: System..::..Single
The pitch shift in semitones to transform.

Return Value

The transformed pitch = Pow( 2, pitch / 12 )

See Also

AudioObject Class


TransformVolume Method

AudioObject..::..TransformVolume Method
AudioObject Class See Also Send Feedback
Transforms the volume to make it perceptually more intuitive to scale and cross-fade.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static float TransformVolume(
    float volume
)

Parameters

volume
Type: System..::..Single
The volume to transform.

Return Value

The transformed volume = Pow( volume, 1.6 )

See Also

AudioObject Class


Unpause Method

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioObject..::..Unpause Method
AudioObject Class See Also Send Feedback

Overload List

 | Name | Description
Public method | Unpause()()()() | Unpauses the audio clip.
Public method | Unpause(Single) | Unpauses the audio clip with a fade-in.

See Also

AudioObject Class
AudioObject Members


Unpause Method

AudioObject..::..Unpause Method
AudioObject Class See Also Send Feedback
Unpauses the audio clip.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void Unpause()

See Also

AudioObject Class
Unpause Overload


Unpause Method (Single)

AudioObject..::..Unpause Method (Single)
AudioObject Class See Also Send Feedback
Unpauses the audio clip with a fade-in.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void Unpause(
    float fadeInTime
)

Parameters

fadeInTime
Type: System..::..Single
The fade-in time in seconds.

See Also

AudioObject Class
Unpause Overload


AudioObject Properties

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioObject Properties
AudioObject Class See Also Send Feedback

The AudioObject type exposes the following members.

Properties

 | Name | Description
Public property | audioID | Gets the audio ID.
Public property | audioItem | Gets the corresponding AudioSubItem
Public property | audioObjectTime | Returns the high precision local time of this audio object
Public property | audioTime | Sets or gets the current audio time relative to ClipStartTime
Public property | category | Gets the category.
Public property | clipLength | Gets the length of the clip.
Public property | completelyPlayedDelegate | Gets or sets the delegate to be called once an audio clip was completely played.
Public property | isFadingIn | return true if the audio is currently fading in
Public property | isFadingOut | return true if the audio is currently fading out
Public property | pan | Sets or gets the audio pan.
Public property | pitch | Sets or gets the audio pitch.
Public property | playCalledAtTime | Gets the systemTime at which the audio Play() function was called.
Public property | primaryAudioSource | returns the primary AudioSource
Public property | scheduledPlayingAtDspTime | Gets or sets the DSP time at which the audio is scheduled to play.
Public property | secondaryAudioSource | returns the secondary AudioSource
Public property | startedPlayingAtTime | Gets the systemTime at which the audio started playing.
Public property | stopAfterFadeOut | If enabled, the audio will stop plaing if a fadeout is finished.
Public property | subItem | Gets the corresponding AudioSubItem
Public property | timeUntilEnd | Gets the time until the clip will stop.
Public property | volume | Gets or sets the volume.
Public property | volumeItem | Gets or sets the volume of the audio item.
Public property | volumeTotal | Gets the total volume.
Public property | volumeTotalWithoutFade | Gets the total volume.

See Also

AudioObject Class


audioID Property

AudioObject..::..audioID Property
AudioObject Class See Also Send Feedback
Gets the audio ID.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public string audioID { get; internal set; }

See Also

AudioObject Class


audioItem Property

AudioObject..::..audioItem Property
AudioObject Class See Also Send Feedback
Gets the corresponding AudioSubItem

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioItem audioItem { get; }

See Also

AudioObject Class


audioObjectTime Property

AudioObject..::..audioObjectTime Property
AudioObject Class See Also Send Feedback
Returns the high precision local time of this audio object

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public double audioObjectTime { get; }

Remarks

The local time is paused when the audio object is paused.

See Also

AudioObject Class


audioTime Property

AudioObject..::..audioTime Property
AudioObject Class See Also Send Feedback
Sets or gets the current audio time relative to ClipStartTime

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float audioTime { get; set; }

See Also

AudioObject Class


category Property

AudioObject..::..category Property
AudioObject Class See Also Send Feedback
Gets the category.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioCategory category { get; internal set; }

See Also

AudioObject Class


clipLength Property

AudioObject..::..clipLength Property
AudioObject Class See Also Send Feedback
Gets the length of the clip.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float clipLength { get; }

Remarks

Is effected by ClipStopTime and ClipStartTime

See Also

AudioObject Class


completelyPlayedDelegate Property

AudioObject..::..completelyPlayedDelegate Property
AudioObject Class See Also Send Feedback
Gets or sets the delegate to be called once an audio clip was completely played.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioObject..::..AudioEventDelegate completelyPlayedDelegate { get; set; }

See Also

AudioObject Class


isFadingIn Property

AudioObject..::..isFadingIn Property
AudioObject Class See Also Send Feedback
return true if the audio is currently fading in

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool isFadingIn { get; }

See Also

AudioObject Class


isFadingOut Property

AudioObject..::..isFadingOut Property
AudioObject Class See Also Send Feedback
return true if the audio is currently fading out

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool isFadingOut { get; }

See Also

AudioObject Class


pan Property

AudioObject..::..pan Property
AudioObject Class See Also Send Feedback
Sets or gets the audio pan.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float pan { get; set; }

See Also

AudioObject Class


pitch Property

AudioObject..::..pitch Property
AudioObject Class See Also Send Feedback
Sets or gets the audio pitch.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float pitch { get; set; }

See Also

AudioObject Class


playCalledAtTime Property

AudioObject..::..playCalledAtTime Property
AudioObject Class See Also Send Feedback
Gets the systemTime at which the audio Play() function was called.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public double playCalledAtTime { get; }

Remarks

If a play was scheduled or delayed, the actual time at which the audio started playing is different.

See Also

AudioObject Class


primaryAudioSource Property

AudioObject..::..primaryAudioSource Property
AudioObject Class See Also Send Feedback
returns the primary AudioSource

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioSource primaryAudioSource { get; }

Remarks

some features like "loop sequence" require an additional AudioSource. Functions like Stop(), FadeIn(), etc. always act on the primary audio source.

See Also

AudioObject Class


scheduledPlayingAtDspTime Property

AudioObject..::..scheduledPlayingAtDspTime Property
AudioObject Class See Also Send Feedback
Gets or sets the DSP time at which the audio is scheduled to play.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public double scheduledPlayingAtDspTime { get; set; }

Return Value

Returns -1 if no audio is scheduled.

See Also

AudioObject Class


secondaryAudioSource Property

AudioObject..::..secondaryAudioSource Property
AudioObject Class See Also Send Feedback
returns the secondary AudioSource

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioSource secondaryAudioSource { get; }

Remarks

some features like "loop sequence" require an additional AudioSource. Functions like Stop(), FadeIn(), etc. always act on the primary audio source.

See Also

AudioObject Class


startedPlayingAtTime Property

AudioObject..::..startedPlayingAtTime Property
AudioObject Class See Also Send Feedback
Gets the systemTime at which the audio started playing.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public double startedPlayingAtTime { get; }

Remarks

If a play was scheduled or delayed, this value is different than playCalledAtTime

See Also

AudioObject Class


stopAfterFadeOut Property

AudioObject..::..stopAfterFadeOut Property
AudioObject Class See Also Send Feedback
If enabled, the audio will stop plaing if a fadeout is finished.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool stopAfterFadeOut { get; set; }

Remarks

Enabled by default.

See Also

AudioObject Class


subItem Property

AudioObject..::..subItem Property
AudioObject Class See Also Send Feedback
Gets the corresponding AudioSubItem

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioSubItem subItem { get; internal set; }

See Also

AudioObject Class


timeUntilEnd Property

AudioObject..::..timeUntilEnd Property
AudioObject Class See Also Send Feedback
Gets the time until the clip will stop.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float timeUntilEnd { get; }

Remarks

Is effected by ClipStopTime

See Also

AudioObject Class


volume Property

AudioObject..::..volume Property
AudioObject Class See Also Send Feedback
Gets or sets the volume.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float volume { get; set; }

Remarks

This is the adjusted volume value with which the Audio clip is currently playing. It is the value resulting from multiplying the volume of the subitem, item, the category, and the script parameter. It does not contain the global volume or the fading value.

"Adjusted" means that the value does not equal Unity's internal audio clip volume value, because Unity's volume range is not distributed is a perceptually even manner.

unityVolume = Mathf.Pow( adjustedVolume, 1.6 )

See Also

AudioObject Class


volumeItem Property

AudioObject..::..volumeItem Property
AudioObject Class See Also Send Feedback
Gets or sets the volume of the audio item.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float volumeItem { get; set; }

Remarks

This is the adjusted volume value with which the Audio clip is currently playing. It is the value resulting from multiplying the volume of the subitem and the item. It does not contain the global volume, the category, the script parameter, or the fading value.

"Adjusted" means that the value does not equal Unity's internal audio clip volume value, because Unity's volume range is not distributed is a perceptually even manner.

unityVolume = Mathf.Pow( adjustedVolume, 1.6 )

See Also

AudioObject Class


volumeTotal Property

AudioObject..::..volumeTotal Property
AudioObject Class See Also Send Feedback
Gets the total volume.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float volumeTotal { get; }

Remarks

This is the adjusted volume value with which the Audio clip is currently playing. It is the value resulting from multiplying the volume of the subitem, item, the category, the script parameter, the global volume, and the fading value.

"Adjusted" means that the value does not equal Unity's internal audio clip volume value, because Unity's volume range is not distributed is a perceptually even manner.

unityVolume = Mathf.Pow( adjustedVolume, 1.6 )

See Also

AudioObject Class


volumeTotalWithoutFade Property

AudioObject..::..volumeTotalWithoutFade Property
AudioObject Class See Also Send Feedback
Gets the total volume.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float volumeTotalWithoutFade { get; }

Remarks

This is the adjusted volume value with which the Audio clip is currently playing without fade in/out. It is the value resulting from multiplying the volume of the subitem, item, the category, the script parameter, the global volume.

"Adjusted" means that the value does not equal Unity's internal audio clip volume value, because Unity's volume range is not distributed is a perceptually even manner.

unityVolume = Mathf.Pow( adjustedVolume, 1.6 )

See Also

AudioObject Class


AudioObject.AudioEventDelegate Delegate

AudioObject..::..AudioEventDelegate Delegate
AudioObject Class See Also Send Feedback
The audio event delegate type.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public delegate void AudioEventDelegate(
    AudioObject audioObject
)

Parameters

audioObject
Type: (Default Namespace)..::..AudioObject

See Also

(Default Namespace) Namespace

Send comments on this topic to ClockStone Support Email

Copyright (c) 2012 by ClockStone Software GmbH


AudioPickSubItemMode Enumeration

AudioPickSubItemMode Enumeration
See Also Send Feedback
Used by AudioItem to determine which AudioSubItem is chosen.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public enum AudioPickSubItemMode

Members

Member name | Value | Description
Disabled | 0 | disables playback
Random | 1 | chooses a random subitem with a probability in proportion to Probability
RandomNotSameTwice | 2 | chooses a random subitem with a probability in proportion to Probability and makes sure it is not played twice in a row (if possible)
Sequence | 3 | chooses the subitems in a sequence one after the other starting with the first
SequenceWithRandomStart | 4 | chooses the subitems in a sequence one after the other starting with a random subitem
AllSimultaneously | 5 | chooses all subitems at the same time
TwoSimultaneously | 6 | chooses two different subitems at the same time (if possible)
StartLoopSequenceWithFirst | 7 | always chooses the first subitem

See Also

(Default Namespace) Namespace

Send comments on this topic to ClockStone Support Email

Copyright (c) 2012 by ClockStone Software GmbH


AudioSubItem Class

AudioSubItem Class
Members See Also Send Feedback
An AudioSubItem represents a specific Unity audio clip.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
[SerializableAttribute]
public class AudioSubItem

Remarks

Add your AudioSubItem to an AudioItem using the Unity inspector.

Inheritance Hierarchy

System..::..Object
(Default Namespace)..::..AudioSubItem

See Also

AudioSubItem Members


AudioSubItem Members

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioSubItem Members
AudioSubItem Class Constructors Methods Fields Properties See Also Send Feedback

The AudioSubItem type exposes the following members.

Constructors

 | Name | Description
Public method | AudioSubItem | Initializes a new instance of the AudioSubItem class

Methods

 | Name | Description
Public method | ToString | Returns the name of the audio clip for debugging. (Overrides Object..::..ToString()()()().)

Fields

 | Name | Description
Public field | Clip | Specifies the AudioClip to be played in case of the Item mode.
Public field | ClipStartTime | Offsets the the audio clip start time (in seconds).
Public field | ClipStopTime | Ends playing the audio at this time (in seconds).
Public field | Delay | Defers the playback of the audio sub-item for Delay seconds.
Public field | FadeIn | Automatic fade-in in seconds
Public field | FadeOut | Automatic fade-out in seconds
Public field | ItemModeAudioID | Specifies the audioID to be played in case of the Item mode
Public field | Pan2D | Alters the pan: -1..left, +1..right
Public field | PitchShift | Alters the pitch in units of semitones ( thus 12 = twice the speed)
Public field | Probability | If multiple sub-items are defined within an audio item, the specific audio clip is chosen with a probability in proportion to the Probability value.
Public field | RandomDelay | Randomly adds a delay between 0 and RandomDelay
Public field | RandomPitch | Randomly shifts the pitch in units of semitones ( thus 12 = twice the speed)
Public field | RandomStartPosition | Starts playing at a random position.
Public field | RandomVolume | Randomly shifts the volume +/- this value
Public field | SubItemType | Specifies the type of this AudioSubItem
Public field | Volume | The volume applied to the audio sub-item.

Properties

 | Name | Description
Public property | item | the AudioItem the sub-item belongs to.

See Also

AudioSubItem Class


AudioSubItem Constructor

AudioSubItem Constructor
AudioSubItem Class See Also Send Feedback
Initializes a new instance of the AudioSubItem class

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioSubItem()

See Also

AudioSubItem Class


AudioSubItem Fields

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioSubItem Fields
AudioSubItem Class See Also Send Feedback

The AudioSubItem type exposes the following members.

Fields

 | Name | Description
Public field | Clip | Specifies the AudioClip to be played in case of the Item mode.
Public field | ClipStartTime | Offsets the the audio clip start time (in seconds).
Public field | ClipStopTime | Ends playing the audio at this time (in seconds).
Public field | Delay | Defers the playback of the audio sub-item for Delay seconds.
Public field | FadeIn | Automatic fade-in in seconds
Public field | FadeOut | Automatic fade-out in seconds
Public field | ItemModeAudioID | Specifies the audioID to be played in case of the Item mode
Public field | Pan2D | Alters the pan: -1..left, +1..right
Public field | PitchShift | Alters the pitch in units of semitones ( thus 12 = twice the speed)
Public field | Probability | If multiple sub-items are defined within an audio item, the specific audio clip is chosen with a probability in proportion to the Probability value.
Public field | RandomDelay | Randomly adds a delay between 0 and RandomDelay
Public field | RandomPitch | Randomly shifts the pitch in units of semitones ( thus 12 = twice the speed)
Public field | RandomStartPosition | Starts playing at a random position.
Public field | RandomVolume | Randomly shifts the volume +/- this value
Public field | SubItemType | Specifies the type of this AudioSubItem
Public field | Volume | The volume applied to the audio sub-item.

See Also

AudioSubItem Class


Clip Field

AudioSubItem..::..Clip Field
AudioSubItem Class See Also Send Feedback
Specifies the AudioClip to be played in case of the Item mode.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioClip Clip

See Also

AudioSubItem Class


ClipStartTime Field

AudioSubItem..::..ClipStartTime Field
AudioSubItem Class See Also Send Feedback
Offsets the the audio clip start time (in seconds).

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float ClipStartTime

Remarks

Does not work with looping.

See Also

AudioSubItem Class


ClipStopTime Field

AudioSubItem..::..ClipStopTime Field
AudioSubItem Class See Also Send Feedback
Ends playing the audio at this time (in seconds).

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float ClipStopTime

Remarks

Can be used as a workaround for an unknown clip length (e.g. for tracker files)

See Also

AudioSubItem Class


Delay Field

AudioSubItem..::..Delay Field
AudioSubItem Class See Also Send Feedback
Defers the playback of the audio sub-item for Delay seconds.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float Delay

See Also

AudioSubItem Class


FadeIn Field

AudioSubItem..::..FadeIn Field
AudioSubItem Class See Also Send Feedback
Automatic fade-in in seconds

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float FadeIn

See Also

AudioSubItem Class


FadeOut Field

AudioSubItem..::..FadeOut Field
AudioSubItem Class See Also Send Feedback
Automatic fade-out in seconds

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float FadeOut

See Also

AudioSubItem Class


ItemModeAudioID Field

AudioSubItem..::..ItemModeAudioID Field
AudioSubItem Class See Also Send Feedback
Specifies the audioID to be played in case of the Item mode

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public string ItemModeAudioID

See Also

AudioSubItem Class


Pan2D Field

AudioSubItem..::..Pan2D Field
AudioSubItem Class See Also Send Feedback
Alters the pan: -1..left, +1..right

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float Pan2D

See Also

AudioSubItem Class


PitchShift Field

AudioSubItem..::..PitchShift Field
AudioSubItem Class See Also Send Feedback
Alters the pitch in units of semitones ( thus 12 = twice the speed)

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float PitchShift

See Also

AudioSubItem Class


Probability Field

AudioSubItem..::..Probability Field
AudioSubItem Class See Also Send Feedback
If multiple sub-items are defined within an audio item, the specific audio clip is chosen with a probability in proportion to the Probability value.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float Probability

See Also

AudioSubItem Class


RandomDelay Field

AudioSubItem..::..RandomDelay Field
AudioSubItem Class See Also Send Feedback
Randomly adds a delay between 0 and RandomDelay

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float RandomDelay

See Also

AudioSubItem Class


RandomPitch Field

AudioSubItem..::..RandomPitch Field
AudioSubItem Class See Also Send Feedback
Randomly shifts the pitch in units of semitones ( thus 12 = twice the speed)

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float RandomPitch

See Also

AudioSubItem Class


RandomStartPosition Field

AudioSubItem..::..RandomStartPosition Field
AudioSubItem Class See Also Send Feedback
Starts playing at a random position.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool RandomStartPosition

Remarks

Useful for audio loops.

See Also

AudioSubItem Class


RandomVolume Field

AudioSubItem..::..RandomVolume Field
AudioSubItem Class See Also Send Feedback
Randomly shifts the volume +/- this value

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float RandomVolume

See Also

AudioSubItem Class


SubItemType Field

AudioSubItem..::..SubItemType Field
AudioSubItem Class See Also Send Feedback
Specifies the type of this AudioSubItem

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioSubItemType SubItemType

See Also

AudioSubItem Class


Volume Field

AudioSubItem..::..Volume Field
AudioSubItem Class See Also Send Feedback
The volume applied to the audio sub-item.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public float Volume

See Also

AudioSubItem Class


AudioSubItem Methods

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioSubItem Methods
AudioSubItem Class See Also Send Feedback

The AudioSubItem type exposes the following members.

Methods

 | Name | Description
Public method | ToString | Returns the name of the audio clip for debugging. (Overrides Object..::..ToString()()()().)

See Also

AudioSubItem Class


ToString Method

AudioSubItem..::..ToString Method
AudioSubItem Class See Also Send Feedback
Returns the name of the audio clip for debugging.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public override string ToString()

Return Value

The debug output string.

See Also

AudioSubItem Class


AudioSubItem Properties

[image]

ClockStone Audio Toolkit for Unity - Documentation
AudioSubItem Properties
AudioSubItem Class See Also Send Feedback

The AudioSubItem type exposes the following members.

Properties

 | Name | Description
Public property | item | the AudioItem the sub-item belongs to.

See Also

AudioSubItem Class


item Property

AudioSubItem..::..item Property
AudioSubItem Class See Also Send Feedback
the AudioItem the sub-item belongs to.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public AudioItem item { get; internal set; }

See Also

AudioSubItem Class


AudioSubItemType Enumeration

AudioSubItemType Enumeration
See Also Send Feedback
The type of an AudioSubItem

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public enum AudioSubItemType

Members

Member name | Value | Description
Clip | 0 | The AudioSubItem plays an AudioClip
Item | 1 | The AudioSubItem plays an AudioItem

See Also

(Default Namespace) Namespace

Send comments on this topic to ClockStone Support Email

Copyright (c) 2012 by ClockStone Software GmbH


IRegisteredComponent Interface

IRegisteredComponent Interface
Members See Also Send Feedback

[Missing <summary> documentation for "T:IRegisteredComponent"]

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public interface IRegisteredComponent

See Also

IRegisteredComponent Members


IRegisteredComponent Members

[image]

ClockStone Audio Toolkit for Unity - Documentation
IRegisteredComponent Members
IRegisteredComponent Interface Methods See Also Send Feedback

The IRegisteredComponent type exposes the following members.

Methods

 | Name | Description
Public method | GetRegisteredComponentBaseClassType |

See Also

IRegisteredComponent Interface


IRegisteredComponent Methods

[image]

ClockStone Audio Toolkit for Unity - Documentation
IRegisteredComponent Methods
IRegisteredComponent Interface See Also Send Feedback

The IRegisteredComponent type exposes the following members.

Methods

 | Name | Description
Public method | GetRegisteredComponentBaseClassType |

See Also

IRegisteredComponent Interface


GetRegisteredComponentBaseClassType Method

IRegisteredComponent..::..GetRegisteredComponentBaseClassType Method
IRegisteredComponent Interface See Also Send Feedback

[Missing <summary> documentation for "M:IRegisteredComponent.GetRegisteredComponentBaseClassType"]

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
Type GetRegisteredComponentBaseClassType()

Return Value

[Missing <returns> documentation for "M:IRegisteredComponent.GetRegisteredComponentBaseClassType"]

See Also

IRegisteredComponent Interface


ObjectPoolController Class

ObjectPoolController Class
Members Example See Also Send Feedback
A static class used to create and destroy poolable objects.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static class ObjectPoolController

Remarks

What is pooling?

GameObject.Instantiate(...) calls are relatively time expensive. If objects of the same type are frequently created and destroyed it is good practice to use object pools, particularly on mobile devices. This can greatly reduce the performance impact for object creation and garbage collection.

How does pooling work?

Instead of actually destroying object instances, they are just set inactive and moved to an object "pool". If a new object is requested it can then simply be pulled from the pool, instead of creating a new instance.

Awake(), Start() and OnDestroy() are called if objects are retrieved from or moved to the pool like they were instantiated and destroyed normally.

Examples

How to set up a prefab for pooling:
  1. Add the PoolableObject script component to the prefab to be pooled. You can set the maximum number of objects to be be stored in the pool from within the inspector.
  2. Replace all Instantiate( myPrefab ) calls with ObjectPoolController.Instantiate( myPrefab )
  3. Replace all Destroy( myObjectInstance ) calls with ObjectPoolController.Destroy( myObjectInstance )
Attention: Be aware that:
  • All data must get initialized in the Awake() or Start() function
  • OnDestroy() will get called a second time once the object really gets destroyed by Unity
  • If a poolable objects gets parented to none-poolable object, the parent must be destroyed using ObjectPoolController.Destroy( ... ) even if it is none-poolable itself.
  • If you store a reference to a poolable object then this reference does not evaluate to null after ObjectPoolController.Destroy( ... ) was called like other references to Unity objects normally would. This is because the object still exists - it is just in the pool. To make sure that a stored reference to a poolable object is still valid you must use PoolableReference<(Of <(<'T>)>)>.

Inheritance Hierarchy

System..::..Object
(Default Namespace)..::..ObjectPoolController

See Also

ObjectPoolController Members
(Default Namespace) Namespace
(Default Namespace)..::..PoolableObject


ObjectPoolController Members

[image]

ClockStone Audio Toolkit for Unity - Documentation
ObjectPoolController Members
ObjectPoolController Class Methods Properties See Also Send Feedback

The ObjectPoolController type exposes the following members.

Methods

Name | Description
Destroy | Destroys the specified game object, respectively sets the object inactive and adds it to the pool.
Instantiate(GameObject) | Retrieves an instance of the specified prefab. Either returns a new instance or it claims an instance from the pool.
Instantiate(GameObject, Vector3, Quaternion) | Retrieves an instance of the specified prefab. Either returns a new instance or it claims an instance from the pool.
InstantiateWithoutPool(GameObject) | Instantiates the specified prefab without using pooling. from the pool.
InstantiateWithoutPool(GameObject, Vector3, Quaternion) | Instantiates the specified prefab without using pooling. from the pool.
Preload | Preloads as many instances to the pool so that there are at least as many as specified in preloadCount.

Properties

Name | Description
isDuringPreload |

See Also

ObjectPoolController Class


ObjectPoolController Methods

[image]

ClockStone Audio Toolkit for Unity - Documentation
ObjectPoolController Methods
ObjectPoolController Class See Also Send Feedback

The ObjectPoolController type exposes the following members.

Methods

Name | Description
Destroy | Destroys the specified game object, respectively sets the object inactive and adds it to the pool.
Instantiate(GameObject) | Retrieves an instance of the specified prefab. Either returns a new instance or it claims an instance from the pool.
Instantiate(GameObject, Vector3, Quaternion) | Retrieves an instance of the specified prefab. Either returns a new instance or it claims an instance from the pool.
InstantiateWithoutPool(GameObject) | Instantiates the specified prefab without using pooling. from the pool.
InstantiateWithoutPool(GameObject, Vector3, Quaternion) | Instantiates the specified prefab without using pooling. from the pool.
Preload | Preloads as many instances to the pool so that there are at least as many as specified in preloadCount.

See Also

ObjectPoolController Class


Destroy Method

ObjectPoolController..::..Destroy Method
ObjectPoolController Class See Also Send Feedback
Destroys the specified game object, respectively sets the object inactive and adds it to the pool.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static void Destroy(
    GameObject obj
)

Parameters

obj
Type: GameObject
The game object.

Remarks

Can be used on none-poolable objects as well. It is good practice to use ObjectPoolController.Destroy whenever you may possibly make your prefab poolable in the future.

Must also be used on none-poolable objects with poolable child objects so the poolable child objects are correctly moved to the pool.

See Also

ObjectPoolController Class
(Default Namespace) Namespace
ObjectPoolController..::..Instantiate(GameObject)


Instantiate Method

[image]

ClockStone Audio Toolkit for Unity - Documentation
ObjectPoolController..::..Instantiate Method
ObjectPoolController Class See Also Send Feedback

Overload List

Name | Description
Instantiate(GameObject) | Retrieves an instance of the specified prefab. Either returns a new instance or it claims an instance from the pool.
Instantiate(GameObject, Vector3, Quaternion) | Retrieves an instance of the specified prefab. Either returns a new instance or it claims an instance from the pool.

See Also

ObjectPoolController Class
ObjectPoolController Members


Instantiate Method ()

ObjectPoolController..::..Instantiate Method ()
ObjectPoolController Class See Also Send Feedback
Retrieves an instance of the specified prefab. Either returns a new instance or it claims an instance from the pool.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static GameObject Instantiate(
    GameObject prefab
)

Parameters

prefab
Type: GameObject
The prefab to be instantiated.

Return Value

An instance of the prefab.

Remarks

Can be used on none-poolable objects as well. It is good practice to use ObjectPoolController.Instantiate whenever you may possibly make your prefab poolable in the future.

See Also

ObjectPoolController Class
Instantiate Overload
(Default Namespace) Namespace
ObjectPoolController..::..Destroy(GameObject)


Instantiate Method (, , )

ObjectPoolController..::..Instantiate Method (, , )
ObjectPoolController Class See Also Send Feedback
Retrieves an instance of the specified prefab. Either returns a new instance or it claims an instance from the pool.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static GameObject Instantiate(
    GameObject prefab,
    Vector3 position,
    Quaternion quaternion
)

Parameters

prefab
Type: GameObject
The prefab to be instantiated.
position
Type: Vector3
The position in world coordinates.
quaternion
Type: Quaternion
The rotation quaternion.

Return Value

An instance of the prefab.

Remarks

Can be used on none-poolable objects as well. It is good practice to use ObjectPoolController.Instantiate whenever you may possibly make your prefab poolable in the future.

See Also

ObjectPoolController Class
Instantiate Overload
(Default Namespace) Namespace
ObjectPoolController..::..Destroy(GameObject)


InstantiateWithoutPool Method

[image]

ClockStone Audio Toolkit for Unity - Documentation
ObjectPoolController..::..InstantiateWithoutPool Method
ObjectPoolController Class See Also Send Feedback

Overload List

Name | Description
InstantiateWithoutPool(GameObject) | Instantiates the specified prefab without using pooling. from the pool.
InstantiateWithoutPool(GameObject, Vector3, Quaternion) | Instantiates the specified prefab without using pooling. from the pool.

See Also

ObjectPoolController Class
ObjectPoolController Members


InstantiateWithoutPool Method ()

ObjectPoolController..::..InstantiateWithoutPool Method ()
ObjectPoolController Class See Also Send Feedback
Instantiates the specified prefab without using pooling. from the pool.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static GameObject InstantiateWithoutPool(
    GameObject prefab
)

Parameters

prefab
Type: GameObject
The prefab to be instantiated.

Return Value

An instance of the prefab.

Remarks

If the prefab is poolable, the PoolableObject component will be removed. This way no warning is generated that a poolable object was created without pooling.

See Also

ObjectPoolController Class
InstantiateWithoutPool Overload


InstantiateWithoutPool Method (, , )

ObjectPoolController..::..InstantiateWithoutPool Method (, , )
ObjectPoolController Class See Also Send Feedback
Instantiates the specified prefab without using pooling. from the pool.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static GameObject InstantiateWithoutPool(
    GameObject prefab,
    Vector3 position,
    Quaternion quaternion
)

Parameters

prefab
Type: GameObject
The prefab to be instantiated.
position
Type: Vector3
The position in world coordinates.
quaternion
Type: Quaternion
The rotation quaternion.

Return Value

An instance of the prefab.

Remarks

If the prefab is poolable, the PoolableObject component will be removed. This way no warning is generated that a poolable object was created without pooling.

See Also

ObjectPoolController Class
InstantiateWithoutPool Overload


Preload Method

ObjectPoolController..::..Preload Method
ObjectPoolController Class See Also Send Feedback
Preloads as many instances to the pool so that there are at least as many as specified in preloadCount.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static void Preload(
    GameObject prefab
)

Parameters

prefab
Type: GameObject
The prefab.

Remarks

Use ObjectPoolController.isDuringPreload to check if an object is preloaded in the Awake() function. If the pool already contains at least preloadCount objects, the function does nothing.

See Also

ObjectPoolController Class
(Default Namespace) Namespace
PoolableObject..::..preloadCount


ObjectPoolController Properties

[image]

ClockStone Audio Toolkit for Unity - Documentation
ObjectPoolController Properties
ObjectPoolController Class See Also Send Feedback

The ObjectPoolController type exposes the following members.

Properties

Name | Description
isDuringPreload |

See Also

ObjectPoolController Class


isDuringPreload Property

ObjectPoolController..::..isDuringPreload Property
ObjectPoolController Class See Also Send Feedback

[Missing <summary> documentation for "P:ObjectPoolController.isDuringPreload"]

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static bool isDuringPreload { get; private set; }

See Also

ObjectPoolController Class


PoolableObject Class

PoolableObject Class
Members See Also Send Feedback
Add this component to your prefab to make it poolable.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public class PoolableObject : MonoBehaviour

Remarks

See ObjectPoolController for an explanation how to set up a prefab for pooling. The following messages are sent to a poolable object:
  • Awake and OnDestroy whenever a poolable object is activated or deactivated from the pool. This way the same behaviour is simulated as if the object was instantiated respectively destroyed. These messages are only sent when sendAwakeStartOnDestroyMessage is enabled.
  • OnPoolableInstanceAwake and OnPoolableInstanceDestroy when the object was actually instantiated respectively destroyed. Because of current Unity limitations OnPoolableInstanceDestroy does not work on Flash!
  • OnPoolableObjectActivated and OnPoolableObjectDeactivated whenever a poolable object is activated or deactivated from the pool. These messages are only sent when sendPoolableActivateDeactivateMessages is enabled.

Inheritance Hierarchy

System..::..Object
Object
Component
Behaviour
MonoBehaviour
(Default Namespace)..::..PoolableObject

See Also

PoolableObject Members
(Default Namespace) Namespace
(Default Namespace)..::..ObjectPoolController


PoolableObject Members

[image]

ClockStone Audio Toolkit for Unity - Documentation
PoolableObject Members
PoolableObject Class Constructors Methods Fields See Also Send Feedback

The PoolableObject type exposes the following members.

Constructors

 | Name | Description
Public method | PoolableObject | Initializes a new instance of the PoolableObject class

Methods

 | Name | Description
Public method | DeactivateAllPoolableObjectsOfMyKind | Moves all poolable objects of this kind (instantiated from the same prefab as this instance) back to the pool.
Public method | GetAllPoolableObjectsOfMyKind | Retrieves an array of all poolable objects of this kind (instantiated from the same prefab as this instance).
Public method | GetSerialNumber | Gets the object's pool serial number. Each object has a unique serial number. Can be useful for debugging purposes.
Public method | GetUsageCount | Gets the usage counter which gets increased each time an object is re-used from the pool.
Public method | IsDeactivated | Checks if the object is deactivated and in the pool.

Fields

 | Name | Description
Public field | doNotDestroyOnLoad | If enabled the object will not get destroyed if a new scene is loaded
Public field | maxPoolSize | The maximum number of instances of this prefab to get stored in the pool.
Public field | preloadCount | This number of instances will be preloaded to the pool if Preload(GameObject) is called.
Public field | sendAwakeStartOnDestroyMessage | If enabled Awake(), Start(), and OnDestroy() messages are sent to the poolable object if the object is set active respectively inactive whenever Destroy(GameObject) or Instantiate(GameObject) is called. This way it is simulated that the object really gets instantiated respectively destroyed.
Public field | sendPoolableActivateDeactivateMessages | If enabled a OnPoolableObjectActivated and OnPoolableObjectDeactivated message is sent to the poolable instance if the object is activated respectively deactivated by the ObjectPoolController

See Also

PoolableObject Class


PoolableObject Constructor

PoolableObject Constructor
PoolableObject Class See Also Send Feedback
Initializes a new instance of the PoolableObject class

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public PoolableObject()

See Also

PoolableObject Class


PoolableObject Fields

[image]

ClockStone Audio Toolkit for Unity - Documentation
PoolableObject Fields
PoolableObject Class See Also Send Feedback

The PoolableObject type exposes the following members.

Fields

 | Name | Description
Public field | doNotDestroyOnLoad | If enabled the object will not get destroyed if a new scene is loaded
Public field | maxPoolSize | The maximum number of instances of this prefab to get stored in the pool.
Public field | preloadCount | This number of instances will be preloaded to the pool if Preload(GameObject) is called.
Public field | sendAwakeStartOnDestroyMessage | If enabled Awake(), Start(), and OnDestroy() messages are sent to the poolable object if the object is set active respectively inactive whenever Destroy(GameObject) or Instantiate(GameObject) is called. This way it is simulated that the object really gets instantiated respectively destroyed.
Public field | sendPoolableActivateDeactivateMessages | If enabled a OnPoolableObjectActivated and OnPoolableObjectDeactivated message is sent to the poolable instance if the object is activated respectively deactivated by the ObjectPoolController

See Also

PoolableObject Class


doNotDestroyOnLoad Field

PoolableObject..::..doNotDestroyOnLoad Field
PoolableObject Class See Also Send Feedback
If enabled the object will not get destroyed if a new scene is loaded

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool doNotDestroyOnLoad

See Also

PoolableObject Class


maxPoolSize Field

PoolableObject..::..maxPoolSize Field
PoolableObject Class See Also Send Feedback
The maximum number of instances of this prefab to get stored in the pool.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public int maxPoolSize

See Also

PoolableObject Class


preloadCount Field

PoolableObject..::..preloadCount Field
PoolableObject Class See Also Send Feedback
This number of instances will be preloaded to the pool if Preload(GameObject) is called.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public int preloadCount

See Also

PoolableObject Class


sendAwakeStartOnDestroyMessage Field

PoolableObject..::..sendAwakeStartOnDestroyMessage Field
PoolableObject Class See Also Send Feedback
If enabled Awake(), Start(), and OnDestroy() messages are sent to the poolable object if the object is set active respectively inactive whenever Destroy(GameObject) or Instantiate(GameObject) is called.

This way it is simulated that the object really gets instantiated respectively destroyed.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool sendAwakeStartOnDestroyMessage

Remarks

The Start() function is called immedialtely after Awake() by Instantiate(GameObject) and not next frame. So do not set data after Instantiate(GameObject) that Start() relies on. In some cases you may not want the Awake(), Start(), and OnDestroy() messages to be sent for performance reasons because it may not be necessary to fully reinitialize a game object each time it is activated from the pool. You can still use the OnPoolableObjectActivated and OnPoolableObjectDeactivated messages to initialize specific data.

See Also

PoolableObject Class


sendPoolableActivateDeactivateMessages Field

PoolableObject..::..sendPoolableActivateDeactivateMessages Field
PoolableObject Class See Also Send Feedback
If enabled a OnPoolableObjectActivated and OnPoolableObjectDeactivated message is sent to the poolable instance if the object is activated respectively deactivated by the ObjectPoolController

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool sendPoolableActivateDeactivateMessages

See Also

PoolableObject Class


PoolableObject Methods

[image]

ClockStone Audio Toolkit for Unity - Documentation
PoolableObject Methods
PoolableObject Class See Also Send Feedback

The PoolableObject type exposes the following members.

Methods

 | Name | Description
Public method | DeactivateAllPoolableObjectsOfMyKind | Moves all poolable objects of this kind (instantiated from the same prefab as this instance) back to the pool.
Public method | GetAllPoolableObjectsOfMyKind | Retrieves an array of all poolable objects of this kind (instantiated from the same prefab as this instance).
Public method | GetSerialNumber | Gets the object's pool serial number. Each object has a unique serial number. Can be useful for debugging purposes.
Public method | GetUsageCount | Gets the usage counter which gets increased each time an object is re-used from the pool.
Public method | IsDeactivated | Checks if the object is deactivated and in the pool.

See Also

PoolableObject Class


DeactivateAllPoolableObjectsOfMyKind Method

PoolableObject..::..DeactivateAllPoolableObjectsOfMyKind Method
PoolableObject Class See Also Send Feedback
Moves all poolable objects of this kind (instantiated from the same prefab as this instance) back to the pool.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public int DeactivateAllPoolableObjectsOfMyKind()

Return Value

The number of instances deactivated and moved back to its pool.

See Also

PoolableObject Class


GetAllPoolableObjectsOfMyKind Method

PoolableObject..::..GetAllPoolableObjectsOfMyKind Method
PoolableObject Class See Also Send Feedback
Retrieves an array of all poolable objects of this kind (instantiated from the same prefab as this instance).

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public PoolableObject[] GetAllPoolableObjectsOfMyKind(
    bool includeInactiveObjects
)

Parameters

includeInactiveObjects
Type: System..::..Boolean
If enabled, the returned array will also include the inactive objects in the pool.

Return Value

The array of poolable objects.

See Also

PoolableObject Class


GetSerialNumber Method

PoolableObject..::..GetSerialNumber Method
PoolableObject Class See Also Send Feedback
Gets the object's pool serial number. Each object has a unique serial number. Can be useful for debugging purposes.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public int GetSerialNumber()

Return Value

The serial number (starting with 1 for each pool).

See Also

PoolableObject Class


GetUsageCount Method

PoolableObject..::..GetUsageCount Method
PoolableObject Class See Also Send Feedback
Gets the usage counter which gets increased each time an object is re-used from the pool.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public int GetUsageCount()

Return Value

The usage counter

See Also

PoolableObject Class


IsDeactivated Method

PoolableObject..::..IsDeactivated Method
PoolableObject Class See Also Send Feedback
Checks if the object is deactivated and in the pool.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public bool IsDeactivated()

Return Value

true if the object is in the pool of deactivated objects, otherwise false.

See Also

PoolableObject Class


PoolableReference(T) Class

PoolableReference<(Of <(<'T>)>)> Class
Members Example See Also Send Feedback
Auxiliary class to overcome the problem of references to pooled objects that should become null when objects are moved back to the pool after calling Destroy(GameObject).

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public class PoolableReference<T>
where T : Component

Type Parameters

T
A UnityEngine.Component

Examples

Instead of a normal reference to a script component on a poolable object use
CopyC#
MyScriptComponent scriptComponent = PoolableObjectController.Instantiate( prefab ).GetComponent<MyScriptComponent>();
var myReference = new PoolableReference<MyScriptComponent>( scriptComponent );
if( myReference.Get() != null ) // will check if poolable instance still belongs to the original object
{
    myReference.Get().MyComponentFunction();
}

Inheritance Hierarchy

System..::..Object
(Default Namespace)..::..PoolableReference<(Of <(<'T>)>)>

See Also

PoolableReference<(Of <(<'T>)>)> Members


PoolableReference(T) Members

[image]

ClockStone Audio Toolkit for Unity - Documentation
PoolableReference<(Of <(<'T>)>)> Members
PoolableReference<(Of <(<'T>)>)> Class Constructors Methods See Also Send Feedback

The PoolableReference<(Of <(<'T>)>)> type exposes the following members.

Constructors

 | Name | Description
Public method | PoolableReference<(Of <(<'T>)>)>()()()() | Initializes a new instance of the PoolableReference<(Of <(<'T>)>)> class with a null reference.
Public method | PoolableReference<(Of <(<'T>)>)>(T) | Initializes a new instance of the PoolableReference<(Of <(<'T>)>)> class with the specified reference.
Public method | PoolableReference<(Of <(<'T>)>)>(PoolableReference<(Of <<'(T>)>>)) | Initializes a new instance of the PoolableReference<(Of <(<'T>)>)> class from a given PoolableReference<(Of <(<'T>)>)>.

Methods

 | Name | Description
Public method | Get | Gets the reference to the script component, or null if the object was already destroyed or moved to the pool.
Public method | Reset | Resets the reference to null.
Public method | Set(T) |
Public method | Set(T, Boolean) | Sets the reference to a poolable object with the specified component.

See Also

PoolableReference<(Of <(<'T>)>)> Class


PoolableReference(T) Constructor

[image]

ClockStone Audio Toolkit for Unity - Documentation
PoolableReference<(Of <(<'T>)>)> Constructor
PoolableReference<(Of <(<'T>)>)> Class See Also Send Feedback

Overload List

 | Name | Description
Public method | PoolableReference<(Of <(<'T>)>)>()()()() | Initializes a new instance of the PoolableReference<(Of <(<'T>)>)> class with a null reference.
Public method | PoolableReference<(Of <(<'T>)>)>(T) | Initializes a new instance of the PoolableReference<(Of <(<'T>)>)> class with the specified reference.
Public method | PoolableReference<(Of <(<'T>)>)>(PoolableReference<(Of <<'(T>)>>)) | Initializes a new instance of the PoolableReference<(Of <(<'T>)>)> class from a given PoolableReference<(Of <(<'T>)>)>.

See Also

PoolableReference<(Of <(<'T>)>)> Class
PoolableReference<(Of <(<'T>)>)> Members


PoolableReference(T) Constructor

PoolableReference<(Of <(<'T>)>)> Constructor
PoolableReference<(Of <(<'T>)>)> Class See Also Send Feedback
Initializes a new instance of the PoolableReference<(Of <(<'T>)>)> class with a null reference.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public PoolableReference()

See Also

PoolableReference<(Of <(<'T>)>)> Class
PoolableReference<(Of <(<'T>)>)> Overload


PoolableReference(T) Constructor (T)

PoolableReference<(Of <(<'T>)>)> Constructor (T)
PoolableReference<(Of <(<'T>)>)> Class See Also Send Feedback
Initializes a new instance of the PoolableReference<(Of <(<'T>)>)> class with the specified reference.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public PoolableReference(
    T componentOfPoolableObject
)

Parameters

componentOfPoolableObject
Type: T
The referenced component of the poolable object.

See Also

PoolableReference<(Of <(<'T>)>)> Class
PoolableReference<(Of <(<'T>)>)> Overload


PoolableReference(T) Constructor (PoolableReference(T))

PoolableReference<(Of <(<'T>)>)> Constructor (PoolableReference<(Of <(<'T>)>)>)
PoolableReference<(Of <(<'T>)>)> Class See Also Send Feedback
Initializes a new instance of the PoolableReference<(Of <(<'T>)>)> class from a given PoolableReference<(Of <(<'T>)>)>.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public PoolableReference(
    PoolableReference<T> poolableReference
)

Parameters

poolableReference
Type: (Default Namespace)..::..PoolableReference <(Of <(<' T >)>)>
The poolable reference.

See Also

PoolableReference<(Of <(<'T>)>)> Class
PoolableReference<(Of <(<'T>)>)> Overload


PoolableReference(T) Methods

[image]

ClockStone Audio Toolkit for Unity - Documentation
PoolableReference<(Of <(<'T>)>)> Methods
PoolableReference<(Of <(<'T>)>)> Class See Also Send Feedback

The PoolableReference<(Of <(<'T>)>)> type exposes the following members.

Methods

 | Name | Description
Public method | Get | Gets the reference to the script component, or null if the object was already destroyed or moved to the pool.
Public method | Reset | Resets the reference to null.
Public method | Set(T) |
Public method | Set(T, Boolean) | Sets the reference to a poolable object with the specified component.

See Also

PoolableReference<(Of <(<'T>)>)> Class


Get Method

PoolableReference<(Of <(<'T>)>)>..::..Get Method
PoolableReference<(Of <(<'T>)>)> Class See Also Send Feedback
Gets the reference to the script component, or null if the object was already destroyed or moved to the pool.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public T Get()

Return Value

The reference to T or null

See Also

PoolableReference<(Of <(<'T>)>)> Class


Reset Method

PoolableReference<(Of <(<'T>)>)>..::..Reset Method
PoolableReference<(Of <(<'T>)>)> Class See Also Send Feedback
Resets the reference to null.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void Reset()

See Also

PoolableReference<(Of <(<'T>)>)> Class


Set Method

[image]

ClockStone Audio Toolkit for Unity - Documentation
PoolableReference<(Of <(<'T>)>)>..::..Set Method
PoolableReference<(Of <(<'T>)>)> Class See Also Send Feedback

Overload List

 | Name | Description
Public method | Set(T) |
Public method | Set(T, Boolean) | Sets the reference to a poolable object with the specified component.

See Also

PoolableReference<(Of <(<'T>)>)> Class
PoolableReference<(Of <(<'T>)>)> Members


Set Method (T)

PoolableReference<(Of <(<'T>)>)>..::..Set Method (T)
PoolableReference<(Of <(<'T>)>)> Class See Also Send Feedback

[Missing <summary> documentation for "M:PoolableReference`1.Set(`0)"]

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void Set(
    T componentOfPoolableObject
)

Parameters

componentOfPoolableObject
Type: T

[Missing <param name="componentOfPoolableObject"/> documentation for "M:PoolableReference`1.Set(`0)"]

See Also

PoolableReference<(Of <(<'T>)>)> Class
Set Overload


Set Method (T, Boolean)

PoolableReference<(Of <(<'T>)>)>..::..Set Method (T, Boolean)
PoolableReference<(Of <(<'T>)>)> Class See Also Send Feedback
Sets the reference to a poolable object with the specified component.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public void Set(
    T componentOfPoolableObject,
    bool allowNonePoolable
)

Parameters

componentOfPoolableObject
Type: T
The component of the poolable object.
allowNonePoolable
Type: System..::..Boolean
If set to false an error is output if the object does not have the PoolableObject component.

See Also

PoolableReference<(Of <(<'T>)>)> Class
Set Overload


RegisteredComponent Class

RegisteredComponent Class
Members See Also Send Feedback
Derive your MonoBehaviour class from RegisteredComponent and all references to instances of this component will be saved in an internal array. Use GetAllOfType<(Of <<'(T>)>>)()()()() to retrieve this array, which is much faster than using Unity's GameObject.FindObjectsOfType() function.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public abstract class RegisteredComponent : MonoBehaviour,
    IRegisteredComponent

Inheritance Hierarchy

System..::..Object
Object
Component
Behaviour
MonoBehaviour
(Default Namespace)..::..RegisteredComponent
(Default Namespace)..::..AudioObject

See Also

RegisteredComponent Members


RegisteredComponent Members

[image]

ClockStone Audio Toolkit for Unity - Documentation
RegisteredComponent Members
RegisteredComponent Class Methods See Also Send Feedback

The RegisteredComponent type exposes the following members.

Methods

 | Name | Description
Public method | GetRegisteredComponentBaseClassType |

See Also

RegisteredComponent Class


RegisteredComponent Methods

[image]

ClockStone Audio Toolkit for Unity - Documentation
RegisteredComponent Methods
RegisteredComponent Class See Also Send Feedback

The RegisteredComponent type exposes the following members.

Methods

 | Name | Description
Public method | GetRegisteredComponentBaseClassType |

See Also

RegisteredComponent Class


GetRegisteredComponentBaseClassType Method

RegisteredComponent..::..GetRegisteredComponentBaseClassType Method
RegisteredComponent Class See Also Send Feedback

[Missing <summary> documentation for "M:RegisteredComponent.GetRegisteredComponentBaseClassType"]

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public Type GetRegisteredComponentBaseClassType()

Return Value

[Missing <returns> documentation for "M:RegisteredComponent.GetRegisteredComponentBaseClassType"]

Implements

IRegisteredComponent..::..GetRegisteredComponentBaseClassType()()()()

See Also

RegisteredComponent Class


RegisteredComponentController Class

RegisteredComponentController Class
Members See Also Send Feedback
This controller provides fast access to all currently existing RegisteredComponent instances.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static class RegisteredComponentController

Remarks

The function GetAllOfType<(Of <<'(T>)>>)()()()() is understood as a replacement for Unity's slow GameObject.FindObjectsOfType() function.

Inheritance Hierarchy

System..::..Object
(Default Namespace)..::..RegisteredComponentController

See Also

RegisteredComponentController Members


RegisteredComponentController Members

[image]

ClockStone Audio Toolkit for Unity - Documentation
RegisteredComponentController Members
RegisteredComponentController Class Methods See Also Send Feedback

The RegisteredComponentController type exposes the following members.

Methods

Name | Description
GetAllOfType(Type) | Retrieves an array of all currently existing instances of the class with type type, (type must be a RegisteredComponent )
GetAllOfType<(Of <<'(T>)>>)()()()() | Retrieves an array of all currently existing instances of the class T, where T must be a RegisteredComponent
InstanceCountOfType<(Of <<'(T>)>>) | Return the number of all currently existing instances of the class T, where T must be a RegisteredComponent

See Also

RegisteredComponentController Class


RegisteredComponentController Methods

[image]

ClockStone Audio Toolkit for Unity - Documentation
RegisteredComponentController Methods
RegisteredComponentController Class See Also Send Feedback

The RegisteredComponentController type exposes the following members.

Methods

Name | Description
GetAllOfType(Type) | Retrieves an array of all currently existing instances of the class with type type, (type must be a RegisteredComponent )
GetAllOfType<(Of <<'(T>)>>)()()()() | Retrieves an array of all currently existing instances of the class T, where T must be a RegisteredComponent
InstanceCountOfType<(Of <<'(T>)>>) | Return the number of all currently existing instances of the class T, where T must be a RegisteredComponent

See Also

RegisteredComponentController Class


GetAllOfType Method

[image]

ClockStone Audio Toolkit for Unity - Documentation
RegisteredComponentController..::..GetAllOfType Method
RegisteredComponentController Class See Also Send Feedback

Overload List

Name | Description
GetAllOfType<(Of <<'(T>)>>)()()()() | Retrieves an array of all currently existing instances of the class T, where T must be a RegisteredComponent
GetAllOfType(Type) | Retrieves an array of all currently existing instances of the class with type type, (type must be a RegisteredComponent )

See Also

RegisteredComponentController Class
RegisteredComponentController Members


GetAllOfType(T) Method

RegisteredComponentController..::..GetAllOfType<(Of <(<'T>)>)> Method
RegisteredComponentController Class See Also Send Feedback
Retrieves an array of all currently existing instances of the class T, where T must be a RegisteredComponent

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static T[] GetAllOfType<T>()
where T : IRegisteredComponent

Type Parameters

T
a class derived from RegisteredComponent

Return Value

The array of instances.

See Also

RegisteredComponentController Class
GetAllOfType Overload


GetAllOfType Method (Type)

RegisteredComponentController..::..GetAllOfType Method (Type)
RegisteredComponentController Class See Also Send Feedback
Retrieves an array of all currently existing instances of the class with type type, (type must be a RegisteredComponent )

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static Object[] GetAllOfType(
    Type type
)

Parameters

type
Type: System..::..Type
The type of the instances to be retrieved

Return Value

The array of instances.

Remarks

Use this function instead of GetAllOfType<T> if you need Flash compatibility.

See Also

RegisteredComponentController Class
GetAllOfType Overload


InstanceCountOfType(T) Method

RegisteredComponentController..::..InstanceCountOfType<(Of <(<'T>)>)> Method
RegisteredComponentController Class See Also Send Feedback
Return the number of all currently existing instances of the class T, where T must be a RegisteredComponent

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static int InstanceCountOfType<T>()
where T : IRegisteredComponent

Type Parameters

T
a class derived from RegisteredComponent

Return Value

The number of instances.

See Also

RegisteredComponentController Class


SingletonMonoBehaviour(T) Class

SingletonMonoBehaviour<(Of <(<'T>)>)> Class
Members Example See Also Send Feedback
Provides singleton-like access to a unique instance of a MonoBehaviour.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public abstract class SingletonMonoBehaviour<T> : MonoBehaviour,
    ISingletonMonoBehaviour
where T : MonoBehaviour

Type Parameters

T
Your singleton MonoBehaviour

Remarks

Makes sure that an instance is available from other Awake() calls even before the singleton's Awake() was called. ( Requires AwakeSingleton() !)

Examples

Derive your own class from SingletonMonoBehaviour.

CopyC#
public class MyScriptClass : SingletonMonoBehaviour<MyScriptClass>
{
    public MyScriptClass()
    {
        MyScriptClass.SetSingletonType( typeof( MyScriptClass ) ); // workaround for Flash
    }
    public void MyFunction() { }
    protected override void Awake()
    {
        base.Awake();
    }
    void AwakeSingleton()
    {
        // all initialisation code here. Will get called from Awake() by singleton.
        // Can get called before Awake() if an instance is accessed in an Awake() function which
        // was called earlier
    }
}

access the instance by writing

CopyC#
MyScriptClass.Instance.MyFunction();

Inheritance Hierarchy

System..::..Object
Object
Component
Behaviour
MonoBehaviour
(Default Namespace)..::..SingletonMonoBehaviour<(Of <(<'T>)>)>
(Default Namespace)..::..AudioController

See Also

SingletonMonoBehaviour<(Of <(<'T>)>)> Members


SingletonMonoBehaviour(T) Members

[image]

ClockStone Audio Toolkit for Unity - Documentation
SingletonMonoBehaviour<(Of <(<'T>)>)> Members
SingletonMonoBehaviour<(Of <(<'T>)>)> Class Methods Properties See Also Send Feedback

The SingletonMonoBehaviour<(Of <(<'T>)>)> type exposes the following members.

Methods

Name | Description
ActivateSingletonInstance | Activates the singleton instance.
DoesInstanceExist | Checks if an instance of this MonoBehaviour exists.
SetSingletonAutoCreate | Sets the object to be instantiated automatically if no instance of the singleton is found.
SetSingletonType | Only required for Flash builds. If this function is not called by the class deriving from SingletonMonoBehaviour in the constructor the singleton can not be found by GetSingleton(...)

Properties

 | Name | Description
 | Instance | Gets the singleton instance.
Public property | isSingletonObject | must return true if this instance of the object is the singleton. Can be used to allow multiple objects of this type that are "add-ons" to the singleton.

See Also

SingletonMonoBehaviour<(Of <(<'T>)>)> Class


SingletonMonoBehaviour(T) Methods

[image]

ClockStone Audio Toolkit for Unity - Documentation
SingletonMonoBehaviour<(Of <(<'T>)>)> Methods
SingletonMonoBehaviour<(Of <(<'T>)>)> Class See Also Send Feedback

The SingletonMonoBehaviour<(Of <(<'T>)>)> type exposes the following members.

Methods

Name | Description
ActivateSingletonInstance | Activates the singleton instance.
DoesInstanceExist | Checks if an instance of this MonoBehaviour exists.
SetSingletonAutoCreate | Sets the object to be instantiated automatically if no instance of the singleton is found.
SetSingletonType | Only required for Flash builds. If this function is not called by the class deriving from SingletonMonoBehaviour in the constructor the singleton can not be found by GetSingleton(...)

See Also

SingletonMonoBehaviour<(Of <(<'T>)>)> Class


ActivateSingletonInstance Method

SingletonMonoBehaviour<(Of <(<'T>)>)>..::..ActivateSingletonInstance Method
SingletonMonoBehaviour<(Of <(<'T>)>)> Class See Also Send Feedback
Activates the singleton instance.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static void ActivateSingletonInstance()

Remarks

Call this function if you set an singleton object inactive before ever accessing the Instance. This is required because Unity does not (yet) offer a way to find inactive game objects.

See Also

SingletonMonoBehaviour<(Of <(<'T>)>)> Class


DoesInstanceExist Method

SingletonMonoBehaviour<(Of <(<'T>)>)>..::..DoesInstanceExist Method
SingletonMonoBehaviour<(Of <(<'T>)>)> Class See Also Send Feedback
Checks if an instance of this MonoBehaviour exists.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static T DoesInstanceExist()

Return Value

A reference to the instance if it exists, otherwise null

See Also

SingletonMonoBehaviour<(Of <(<'T>)>)> Class


SetSingletonAutoCreate Method

SingletonMonoBehaviour<(Of <(<'T>)>)>..::..SetSingletonAutoCreate Method
SingletonMonoBehaviour<(Of <(<'T>)>)> Class See Also Send Feedback
Sets the object to be instantiated automatically if no instance of the singleton is found.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static void SetSingletonAutoCreate(
    GameObject autoCreatePrefab
)

Parameters

autoCreatePrefab
Type: GameObject
The prefab to be instantiated automatically.

Remarks

Either the game object itself or one of its child objects must contain the singleton component

See Also

SingletonMonoBehaviour<(Of <(<'T>)>)> Class


SetSingletonType Method

SingletonMonoBehaviour<(Of <(<'T>)>)>..::..SetSingletonType Method
SingletonMonoBehaviour<(Of <(<'T>)>)> Class See Also Send Feedback
Only required for Flash builds. If this function is not called by the class deriving from SingletonMonoBehaviour in the constructor the singleton can not be found by GetSingleton(...)

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static void SetSingletonType(
    Type type
)

Parameters

type
Type: System..::..Type

[Missing <param name="type"/> documentation for "M:SingletonMonoBehaviour`1.SetSingletonType(System.Type)"]

See Also

SingletonMonoBehaviour<(Of <(<'T>)>)> Class


SingletonMonoBehaviour(T) Properties

[image]

ClockStone Audio Toolkit for Unity - Documentation
SingletonMonoBehaviour<(Of <(<'T>)>)> Properties
SingletonMonoBehaviour<(Of <(<'T>)>)> Class See Also Send Feedback

The SingletonMonoBehaviour<(Of <(<'T>)>)> type exposes the following members.

Properties

 | Name | Description
 | Instance | Gets the singleton instance.
Public property | isSingletonObject | must return true if this instance of the object is the singleton. Can be used to allow multiple objects of this type that are "add-ons" to the singleton.

See Also

SingletonMonoBehaviour<(Of <(<'T>)>)> Class


Instance Property

SingletonMonoBehaviour<(Of <(<'T>)>)>..::..Instance Property
SingletonMonoBehaviour<(Of <(<'T>)>)> Class See Also Send Feedback
Gets the singleton instance.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static T Instance { get; }

Return Value

A reference to the instance if it exists, otherwise null

Remarks

Outputs an error to the debug log if no instance was found.

See Also

SingletonMonoBehaviour<(Of <(<'T>)>)> Class


isSingletonObject Property

SingletonMonoBehaviour<(Of <(<'T>)>)>..::..isSingletonObject Property
SingletonMonoBehaviour<(Of <(<'T>)>)> Class See Also Send Feedback
must return true if this instance of the object is the singleton. Can be used to allow multiple objects of this type that are "add-ons" to the singleton.

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public virtual bool isSingletonObject { get; }

See Also

SingletonMonoBehaviour<(Of <(<'T>)>)> Class