AudioSource
La référence est en anglais : elle est générée à partir des commentaires du code, écrits en anglais.
public sealed class AudioSource : BehaviourNamespace NodeWorld.Flux.
An Audio Source of the world: plays its clip, in 2D or 3D, as Unity's. The server has none.
Properties
clip
public AudioClip clip { get; set; }The clip the source plays: set it, then Play.
isPlaying
public bool isPlaying { get; }The source is playing.
loop
public bool loop { get; set; }The clip starts again when it ends.
mute
public bool mute { get; set; }Silences the source; it keeps playing.
playOnAwake
public bool playOnAwake { get; set; }The source plays as soon as its object becomes active.
priority
public int priority { get; set; }Priority among the sources: 0 the highest, 256 the lowest.
volume
public float volume { get; set; }Volume, 0 to 1.
pitch
public float pitch { get; set; }Pitch and speed of the clip (1: as it is).
time
public float time { get; set; }Playback position (s).
spatialBlend
public float spatialBlend { get; set; }2D (0) to 3D (1): a 3D sound comes from its object and fades with the distance.
minDistance
public float minDistance { get; set; }Distance (m) within which a 3D sound is at full volume.
maxDistance
public float maxDistance { get; set; }Distance (m) beyond which a 3D sound no longer fades.
Methods
Play
public void Play()Plays the clip from its start.
PlayDelayed
public void PlayDelayed(float delay)Plays the clip after delay seconds.
Stop
public void Stop()Stops the clip.
Pause
public void Pause()Pauses the clip.
UnPause
public void UnPause()Plays a paused clip on from where it was.
PlayOneShot
public void PlayOneShot(AudioClip clip, float volumeScale = 1f)Plays clip once, over what the source plays, with the source's settings and volumeScale times its volume.
GetSpectrumData
public void GetSpectrumData(float[] samples, int channel, FFTWindow window)The spectrum of what this source plays (FFT, samples.Length a power of two from 64 to 8192).
GetOutputData
public void GetOutputData(float[] samples, int channel)The last samples this source played (waveform), samples.Length of them.
