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.
Public method Static member InverseTransformPitch
Inverse pitch transformation: TransformPitch(Single)
Public method Static member 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
Public method Static member TransformPitch
Transforms the pitch from semitones to a multiplicative factor
Public method Static member 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 isFadeOutComplete
return true if the audio has completely faded out
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 isFadingOutOrScheduled
return true if the audio is currently fading out or is scheduled to fade out
Public property isPlayedAsMusicOrAmbienceSound
Returns true if the audio object is treated as music
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