public void PlayOnce(string soundFile, bool wait) { this.sound = new SoundThread (soundFile, false); this.main = new Thread (new ThreadStart (this.sound.Play)); this.main.Start (); if (wait) { this.main.Join (); this.main = null; } }
// Methods public void PlayLoop(string soundFile) { this.sound = new SoundThread (soundFile, true); this.main = new Thread (new ThreadStart (this.sound.Play)); this.main.Start (); }