public AudioAsset(string fileName, bool stream = false) : base(fileName) { if (!stream) Clip = new AudioClip(FileName); }
public void Play (AudioClip clip, bool loop = false) { this.Stop (); // kill the streaming thread if required if (this.streamWorker != null && this.streamWorker.IsAlive) this.streamWorker.Abort (); AL.Source (this.audioSourceId, ALSourcei.Buffer, clip.BufferId); AL.Source (this.audioSourceId, ALSourceb.Looping, loop); AL.SourcePlay (this.audioSourceId); }