Class AudioSource
Assembly: UnityEngine.dll
Syntax
[RequireComponent(typeof(Transform))]
public sealed class AudioSource : AudioBehaviour
Properties
bypassEffects
Declaration
public bool bypassEffects { get; set; }
Property Value
bypassListenerEffects
Declaration
public bool bypassListenerEffects { get; set; }
Property Value
bypassReverbZones
Declaration
public bool bypassReverbZones { get; set; }
Property Value
clip
Declaration
public AudioClip clip { get; set; }
Property Value
dopplerLevel
Declaration
public float dopplerLevel { get; set; }
Property Value
ignoreListenerPause
Declaration
public bool ignoreListenerPause { get; set; }
Property Value
ignoreListenerVolume
Declaration
public bool ignoreListenerVolume { get; set; }
Property Value
isPlaying
Declaration
public bool isPlaying { get; }
Property Value
isVirtual
Declaration
public bool isVirtual { get; }
Property Value
loop
Declaration
public bool loop { get; set; }
Property Value
maxDistance
Declaration
public float maxDistance { get; set; }
Property Value
maxVolume
Declaration
[Obsolete("maxVolume is not supported anymore. Use min-, maxDistance and rolloffMode instead.", true)]
public float maxVolume { get; set; }
Property Value
minDistance
Declaration
public float minDistance { get; set; }
Property Value
minVolume
Declaration
[Obsolete("minVolume is not supported anymore. Use min-, maxDistance and rolloffMode instead.", true)]
public float minVolume { get; set; }
Property Value
mute
Declaration
public bool mute { get; set; }
Property Value
outputAudioMixerGroup
Declaration
public AudioMixerGroup outputAudioMixerGroup { get; set; }
Property Value
panStereo
Declaration
public float panStereo { get; set; }
Property Value
pitch
Declaration
public float pitch { get; set; }
Property Value
playOnAwake
Declaration
public bool playOnAwake { get; set; }
Property Value
priority
Declaration
public int priority { get; set; }
Property Value
reverbZoneMix
Declaration
public float reverbZoneMix { get; set; }
Property Value
rolloffFactor
Declaration
[Obsolete("rolloffFactor is not supported anymore. Use min-, maxDistance and rolloffMode instead.", true)]
public float rolloffFactor { get; set; }
Property Value
rolloffMode
Declaration
public AudioRolloffMode rolloffMode { get; set; }
Property Value
spatialBlend
Declaration
public float spatialBlend { get; set; }
Property Value
|
Improve this Doc
View Source
spatialize
Declaration
public bool spatialize { get; set; }
Property Value
spatializePostEffects
Declaration
public bool spatializePostEffects { get; set; }
Property Value
spread
Declaration
public float spread { get; set; }
Property Value
time
Declaration
public float time { get; set; }
Property Value
timeSamples
Declaration
public int timeSamples { get; set; }
Property Value
velocityUpdateMode
Declaration
public AudioVelocityUpdateMode velocityUpdateMode { get; set; }
Property Value
volume
Declaration
public float volume { get; set; }
Property Value
Methods
DisableDualShock4Output()
Declaration
public bool DisableDualShock4Output()
Returns
GetAmbisonicDecoderFloat(Int32, out Single)
Declaration
public bool GetAmbisonicDecoderFloat(int index, out float value)
Parameters
Returns
GetCustomCurve(AudioSourceCurveType)
Declaration
public AnimationCurve GetCustomCurve(AudioSourceCurveType type)
Parameters
Returns
|
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
|
Improve this Doc
View Source
GetOutputData(Single[], Int32)
Declaration
public void GetOutputData(float[] samples, int channel)
Parameters
GetSpatializerFloat(Int32, out Single)
Declaration
public bool GetSpatializerFloat(int index, out float value)
Parameters
Returns
|
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
Returns
|
Improve this Doc
View Source
GetSpectrumData(Single[], Int32, FFTWindow)
Declaration
public void GetSpectrumData(float[] samples, int channel, FFTWindow window)
Parameters
|
Improve this Doc
View Source
Pause()
Declaration
|
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
|
Improve this Doc
View Source
PlayClipAtPoint(AudioClip, Vector3, Single)
Declaration
public static void PlayClipAtPoint(AudioClip clip, Vector3 position, [DefaultValue("1.0F")] float volume)
Parameters
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
PlayOnDualShock4PadIndex(Int32)
Declaration
public bool PlayOnDualShock4PadIndex(int padIndex)
Parameters
Type |
Name |
Description |
Int32 |
padIndex |
|
Returns
|
Improve this Doc
View Source
PlayOneShot(AudioClip)
Declaration
[ExcludeFromDocs]
public void PlayOneShot(AudioClip clip)
Parameters
|
Improve this Doc
View Source
PlayOneShot(AudioClip, Single)
Declaration
public void PlayOneShot(AudioClip clip, [DefaultValue("1.0F")] float volumeScale)
Parameters
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
Returns
SetCustomCurve(AudioSourceCurveType, AnimationCurve)
Declaration
public void SetCustomCurve(AudioSourceCurveType type, AnimationCurve curve)
Parameters
SetDualShock4PadSpeakerMixLevel(Int32, Int32)
Declaration
public bool SetDualShock4PadSpeakerMixLevel(int userId, int mixLevel)
Parameters
Returns
SetDualShock4PadSpeakerMixLevelDefault(Int32)
Declaration
public bool SetDualShock4PadSpeakerMixLevelDefault(int userId)
Parameters
Type |
Name |
Description |
Int32 |
userId |
|
Returns
SetDualShock4PadSpeakerMixLevelDefaultPadIndex(Int32)
Declaration
public bool SetDualShock4PadSpeakerMixLevelDefaultPadIndex(int padIndex)
Parameters
Type |
Name |
Description |
Int32 |
padIndex |
|
Returns
SetDualShock4PadSpeakerMixLevelPadIndex(Int32, Int32)
Declaration
public bool SetDualShock4PadSpeakerMixLevelPadIndex(int padIndex, int mixLevel)
Parameters
Type |
Name |
Description |
Int32 |
padIndex |
|
Int32 |
mixLevel |
|
Returns
SetDualShock4PadSpeakerRestrictedAudio(Int32, Boolean)
Declaration
public bool SetDualShock4PadSpeakerRestrictedAudio(int userId, bool restricted)
Parameters
Returns
SetDualShock4PadSpeakerRestrictedAudioPadIndex(Int32, Boolean)
Declaration
public bool SetDualShock4PadSpeakerRestrictedAudioPadIndex(int padIndex, bool restricted)
Parameters
Returns
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
Returns
Stop()
Declaration
|
Improve this Doc
View Source
UnPause()
Declaration
Extension Methods