public void Play() { state = SoundEffectState.PLAYING; SoundEffectInstance newInstance = soundEffect.CreateInstance(); instances.Add(newInstance); foreach (SoundEffectInstance sei in instances) { sei.Play(); } }
public void Stop() { state = SoundEffectState.STOPPED; foreach (SoundEffectInstance sei in instances) { sei.Stop(); } this.Dispose(); }
public void Pause() { state = SoundEffectState.PAUSED; foreach (SoundEffectInstance sei in instances) { sei.Pause(); } }
public void Play() { if (instances.Count < 8) { state = SoundEffectState.PLAYING; SoundEffectInstance newInstance = soundEffect.CreateInstance(); instances.Add(newInstance); foreach (SoundEffectInstance sei in instances) { sei.IsLooped = IsLooped; sei.Play(); } } }