Click or drag to resize

AudioObject Methods

The AudioObject type exposes the following members.

Methods
  NameDescription
Public methodDestroyAudioObject
Destroys the audio object (using ObjectPoolController if pooling is enabled)
Public methodDoesBelongToCategory
Checks if this AudioObject belongs to a specific category
Public methodFadeIn
Fades-in a playing audio.
Public methodFadeOut(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 methodFadeOut(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 methodFinishSequence
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 methodStatic memberInverseTransformPitch
Inverse pitch transformation: TransformPitch(Single)
Public methodStatic memberInverseTransformVolume
Inverse volume transformation TransformVolume(Single)
Public methodIsPaused
Determines whether the audio clip is paused.
Public methodIsPlaying
Determines if either the primary or the secondary audio clip is playing.
Public methodIsPrimaryPlaying
Determines if the primary audio clip is playing.
Public methodIsSecondaryPlaying
Determines if the secondary audio clip is playing.
Public methodPause
Pauses the audio clip.
Public methodPause(Single)
Pauses the audio clip with a fade-out.
Public methodPlay
Plays the audio clip with the specified delay.
Public methodPlayAfter
Plays the specified audio after the current has finished playing
Public methodPlayNow
Plays the specified audio.
Public methodPlayScheduled
Plays the audio clip at the specified high precision DSP time (see the Unity AudioSettings.dspTime documentation)
Public methodStop
Stops playing this instance.
Public methodStop(Single)
Stops a playing audio with fade-out.
Public methodStop(Single, Single)
Stops a playing audio with fade-out at a specified time.
Public methodCode exampleSwitchAudioSources
Switches the primary and secondary audio source
Public methodStatic memberTransformPitch
Transforms the pitch from semitones to a multiplicative factor
Public methodStatic memberTransformVolume
Transforms the volume to make it perceptually more intuitive to scale and cross-fade.
Public methodUnpause
Unpauses the audio clip.
Public methodUnpause(Single)
Unpauses the audio clip with a fade-in.
Top
See Also