Show / Hide Table of Contents

Class AudioSource

Inheritance
Object
Object
Component
Behaviour
AudioBehaviour
AudioSource
Inherited Members
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.transform
Component.gameObject
Component.GetComponent(Type)
Component.GetComponent<T>()
Component.GetComponent(String)
Component.GetComponentInChildren(Type, Boolean)
Component.GetComponentInChildren(Type)
Component.GetComponentInChildren<T>(Boolean)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren(Type, Boolean)
Component.GetComponentsInChildren(Type)
Component.GetComponentsInChildren<T>(Boolean)
Component.GetComponentsInChildren<T>(Boolean, List<T>)
Component.GetComponentsInChildren<T>()
Component.GetComponentsInChildren<T>(List<T>)
Component.GetComponentInParent(Type)
Component.GetComponentInParent<T>()
Component.GetComponentsInParent(Type, Boolean)
Component.GetComponentsInParent(Type)
Component.GetComponentsInParent<T>(Boolean)
Component.GetComponentsInParent<T>(Boolean, List<T>)
Component.GetComponentsInParent<T>()
Component.GetComponents(Type)
Component.GetComponents(Type, List<Component>)
Component.GetComponents<T>(List<T>)
Component.tag
Component.GetComponents<T>()
Component.CompareTag(String)
Component.SendMessageUpwards(String, Object, SendMessageOptions)
Component.SendMessageUpwards(String, Object)
Component.SendMessageUpwards(String)
Component.SendMessageUpwards(String, SendMessageOptions)
Component.SendMessage(String, Object)
Component.SendMessage(String)
Component.SendMessage(String, Object, SendMessageOptions)
Component.SendMessage(String, SendMessageOptions)
Component.BroadcastMessage(String, Object, SendMessageOptions)
Component.BroadcastMessage(String, Object)
Component.BroadcastMessage(String)
Component.BroadcastMessage(String, SendMessageOptions)
Object.GetInstanceID()
Object.GetHashCode()
Object.Equals(Object)
Object.name
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Transform)
Object.Instantiate(Object, Transform, Boolean)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Instantiate<T>(T, Transform, Boolean)
Object.Destroy(Object, Single)
Object.Destroy(Object)
Object.DestroyImmediate(Object, Boolean)
Object.DestroyImmediate(Object)
Object.FindObjectsOfType(Type)
Object.DontDestroyOnLoad(Object)
Object.hideFlags
Object.DestroyObject(Object, Single)
Object.DestroyObject(Object)
Object.FindSceneObjectsOfType(Type)
Object.FindObjectsOfTypeIncludingAssets(Type)
Object.FindObjectsOfType<T>()
Object.FindObjectOfType<T>()
Object.FindObjectsOfTypeAll(Type)
Object.FindObjectOfType(Type)
Object.ToString()
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetType()
Object.MemberwiseClone()
Namespace: UnityEngine
Assembly: UnityEngine.dll
Syntax
[RequireComponent(typeof(Transform))]
public sealed class AudioSource : AudioBehaviour

Properties

bypassEffects

Declaration
public bool bypassEffects { get; set; }
Property Value
Type Description
Boolean

bypassListenerEffects

Declaration
public bool bypassListenerEffects { get; set; }
Property Value
Type Description
Boolean

bypassReverbZones

Declaration
public bool bypassReverbZones { get; set; }
Property Value
Type Description
Boolean

clip

Declaration
public AudioClip clip { get; set; }
Property Value
Type Description
AudioClip

dopplerLevel

Declaration
public float dopplerLevel { get; set; }
Property Value
Type Description
Single

ignoreListenerPause

Declaration
public bool ignoreListenerPause { get; set; }
Property Value
Type Description
Boolean

ignoreListenerVolume

Declaration
public bool ignoreListenerVolume { get; set; }
Property Value
Type Description
Boolean

isPlaying

Declaration
public bool isPlaying { get; }
Property Value
Type Description
Boolean

isVirtual

Declaration
public bool isVirtual { get; }
Property Value
Type Description
Boolean

loop

Declaration
public bool loop { get; set; }
Property Value
Type Description
Boolean

maxDistance

Declaration
public float maxDistance { get; set; }
Property Value
Type Description
Single

maxVolume

Declaration
[Obsolete("maxVolume is not supported anymore. Use min-, maxDistance and rolloffMode instead.", true)]
public float maxVolume { get; set; }
Property Value
Type Description
Single

minDistance

Declaration
public float minDistance { get; set; }
Property Value
Type Description
Single

minVolume

Declaration
[Obsolete("minVolume is not supported anymore. Use min-, maxDistance and rolloffMode instead.", true)]
public float minVolume { get; set; }
Property Value
Type Description
Single

mute

Declaration
public bool mute { get; set; }
Property Value
Type Description
Boolean

outputAudioMixerGroup

Declaration
public AudioMixerGroup outputAudioMixerGroup { get; set; }
Property Value
Type Description
AudioMixerGroup

panStereo

Declaration
public float panStereo { get; set; }
Property Value
Type Description
Single

pitch

Declaration
public float pitch { get; set; }
Property Value
Type Description
Single

playOnAwake

Declaration
public bool playOnAwake { get; set; }
Property Value
Type Description
Boolean

priority

Declaration
public int priority { get; set; }
Property Value
Type Description
Int32

reverbZoneMix

Declaration
public float reverbZoneMix { get; set; }
Property Value
Type Description
Single

rolloffFactor

Declaration
[Obsolete("rolloffFactor is not supported anymore. Use min-, maxDistance and rolloffMode instead.", true)]
public float rolloffFactor { get; set; }
Property Value
Type Description
Single

rolloffMode

Declaration
public AudioRolloffMode rolloffMode { get; set; }
Property Value
Type Description
AudioRolloffMode

spatialBlend

Declaration
public float spatialBlend { get; set; }
Property Value
Type Description
Single
| Improve this Doc View Source

spatialize

Declaration
public bool spatialize { get; set; }
Property Value
Type Description
Boolean

spatializePostEffects

Declaration
public bool spatializePostEffects { get; set; }
Property Value
Type Description
Boolean

spread

Declaration
public float spread { get; set; }
Property Value
Type Description
Single

time

Declaration
public float time { get; set; }
Property Value
Type Description
Single

timeSamples

Declaration
public int timeSamples { get; set; }
Property Value
Type Description
Int32

velocityUpdateMode

Declaration
public AudioVelocityUpdateMode velocityUpdateMode { get; set; }
Property Value
Type Description
AudioVelocityUpdateMode

volume

Declaration
public float volume { get; set; }
Property Value
Type Description
Single

Methods

DisableDualShock4Output()

Declaration
public bool DisableDualShock4Output()
Returns
Type Description
Boolean

GetAmbisonicDecoderFloat(Int32, out Single)

Declaration
public bool GetAmbisonicDecoderFloat(int index, out float value)
Parameters
Type Name Description
Int32 index
Single value
Returns
Type Description
Boolean

GetCustomCurve(AudioSourceCurveType)

Declaration
public AnimationCurve GetCustomCurve(AudioSourceCurveType type)
Parameters
Type Name Description
AudioSourceCurveType type
Returns
Type Description
AnimationCurve
| Improve this Doc View Source

GetOutputData(Int32, Int32)

Declaration
[Obsolete("GetOutputData return a float[] is deprecated, use GetOutputData passing a pre allocated array instead.")]
public float[] GetOutputData(int numSamples, int channel)
Parameters
Type Name Description
Int32 numSamples
Int32 channel
Returns
Type Description
Single[]
| Improve this Doc View Source

GetOutputData(Single[], Int32)

Declaration
public void GetOutputData(float[] samples, int channel)
Parameters
Type Name Description
Single[] samples
Int32 channel

GetSpatializerFloat(Int32, out Single)

Declaration
public bool GetSpatializerFloat(int index, out float value)
Parameters
Type Name Description
Int32 index
Single value
Returns
Type Description
Boolean
| Improve this Doc View Source

GetSpectrumData(Int32, Int32, FFTWindow)

Declaration
[Obsolete("GetSpectrumData returning a float[] is deprecated, use GetSpectrumData passing a pre allocated array instead.")]
public float[] GetSpectrumData(int numSamples, int channel, FFTWindow window)
Parameters
Type Name Description
Int32 numSamples
Int32 channel
FFTWindow window
Returns
Type Description
Single[]
| Improve this Doc View Source

GetSpectrumData(Single[], Int32, FFTWindow)

Declaration
public void GetSpectrumData(float[] samples, int channel, FFTWindow window)
Parameters
Type Name Description
Single[] samples
Int32 channel
FFTWindow window
| Improve this Doc View Source

Pause()

Declaration
public void Pause()
| Improve this Doc View Source

Play()

Declaration
[ExcludeFromDocs]
public void Play()

Play(UInt64)

Declaration
public void Play([DefaultValue("0")] ulong delay)
Parameters
Type Name Description
UInt64 delay
| Improve this Doc View Source

PlayClipAtPoint(AudioClip, Vector3)

Declaration
[ExcludeFromDocs]
public static void PlayClipAtPoint(AudioClip clip, Vector3 position)
Parameters
Type Name Description
AudioClip clip
Vector3 position
| Improve this Doc View Source

PlayClipAtPoint(AudioClip, Vector3, Single)

Declaration
public static void PlayClipAtPoint(AudioClip clip, Vector3 position, [DefaultValue("1.0F")] float volume)
Parameters
Type Name Description
AudioClip clip
Vector3 position
Single volume

PlayDelayed(Single)

Declaration
public void PlayDelayed(float delay)
Parameters
Type Name Description
Single delay

PlayOnDualShock4(Int32)

Declaration
public bool PlayOnDualShock4(int userId)
Parameters
Type Name Description
Int32 userId
Returns
Type Description
Boolean

PlayOnDualShock4PadIndex(Int32)

Declaration
public bool PlayOnDualShock4PadIndex(int padIndex)
Parameters
Type Name Description
Int32 padIndex
Returns
Type Description
Boolean
| Improve this Doc View Source

PlayOneShot(AudioClip)

Declaration
[ExcludeFromDocs]
public void PlayOneShot(AudioClip clip)
Parameters
Type Name Description
AudioClip clip
| Improve this Doc View Source

PlayOneShot(AudioClip, Single)

Declaration
public void PlayOneShot(AudioClip clip, [DefaultValue("1.0F")] float volumeScale)
Parameters
Type Name Description
AudioClip clip
Single volumeScale

PlayScheduled(Double)

Declaration
public void PlayScheduled(double time)
Parameters
Type Name Description
Double time

SetAmbisonicDecoderFloat(Int32, Single)

Declaration
public bool SetAmbisonicDecoderFloat(int index, float value)
Parameters
Type Name Description
Int32 index
Single value
Returns
Type Description
Boolean

SetCustomCurve(AudioSourceCurveType, AnimationCurve)

Declaration
public void SetCustomCurve(AudioSourceCurveType type, AnimationCurve curve)
Parameters
Type Name Description
AudioSourceCurveType type
AnimationCurve curve

SetDualShock4PadSpeakerMixLevel(Int32, Int32)

Declaration
public bool SetDualShock4PadSpeakerMixLevel(int userId, int mixLevel)
Parameters
Type Name Description
Int32 userId
Int32 mixLevel
Returns
Type Description
Boolean

SetDualShock4PadSpeakerMixLevelDefault(Int32)

Declaration
public bool SetDualShock4PadSpeakerMixLevelDefault(int userId)
Parameters
Type Name Description
Int32 userId
Returns
Type Description
Boolean

SetDualShock4PadSpeakerMixLevelDefaultPadIndex(Int32)

Declaration
public bool SetDualShock4PadSpeakerMixLevelDefaultPadIndex(int padIndex)
Parameters
Type Name Description
Int32 padIndex
Returns
Type Description
Boolean

SetDualShock4PadSpeakerMixLevelPadIndex(Int32, Int32)

Declaration
public bool SetDualShock4PadSpeakerMixLevelPadIndex(int padIndex, int mixLevel)
Parameters
Type Name Description
Int32 padIndex
Int32 mixLevel
Returns
Type Description
Boolean

SetDualShock4PadSpeakerRestrictedAudio(Int32, Boolean)

Declaration
public bool SetDualShock4PadSpeakerRestrictedAudio(int userId, bool restricted)
Parameters
Type Name Description
Int32 userId
Boolean restricted
Returns
Type Description
Boolean

SetDualShock4PadSpeakerRestrictedAudioPadIndex(Int32, Boolean)

Declaration
public bool SetDualShock4PadSpeakerRestrictedAudioPadIndex(int padIndex, bool restricted)
Parameters
Type Name Description
Int32 padIndex
Boolean restricted
Returns
Type Description
Boolean

SetScheduledEndTime(Double)

Declaration
public void SetScheduledEndTime(double time)
Parameters
Type Name Description
Double time

SetScheduledStartTime(Double)

Declaration
public void SetScheduledStartTime(double time)
Parameters
Type Name Description
Double time

SetSpatializerFloat(Int32, Single)

Declaration
public bool SetSpatializerFloat(int index, float value)
Parameters
Type Name Description
Int32 index
Single value
Returns
Type Description
Boolean

Stop()

Declaration
public void Stop()
| Improve this Doc View Source

UnPause()

Declaration
public void UnPause()

Extension Methods

MustExtensions.MustBeEqual<T>(T, T)
MustExtensions.MustBeEqual<T>(T, T, String)
MustExtensions.MustNotBeEqual<T>(T, T)
MustExtensions.MustNotBeEqual<T>(T, T, String)
MustExtensions.MustBeNull<T>(T)
MustExtensions.MustBeNull<T>(T, String)
MustExtensions.MustNotBeNull<T>(T)
MustExtensions.MustNotBeNull<T>(T, String)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX