public override void Run() { AudioContext.Initialize(); WavAudioSource source = new WavAudioSource("Resources/garbage_day.wav"); AudioClip clip = new AudioClip(source); AudioEmitter emitter = new AudioEmitter(); emitter.AddClip(clip); clip.Play(); while (clip.State != AudioClipState.Ended) { emitter.Process(); } AudioContext.Destroy(); }
public void RemoveClip(AudioClip clip) { _sources.Remove(clip); }
public void AddClip(AudioClip clip) { _sources.Add(clip); }