Пример #1
0
 public AudioAsset(string fileName, bool stream = false) : base(fileName)
 {
     if (!stream)
         Clip = new AudioClip(FileName);
 }
Пример #2
0
		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);
		}