void PlayCue(ref Cue cue) { if (cue.IsStopped || cue.IsStopping) { string name = cue.Name; cue.Dispose(); cue = _soundBank.GetCue(name); } if (!cue.IsPlaying) cue.Play(); }
private void PlaySoundMainSE(string se) { engineSound2 = soundBank2.GetCue(se); SetVolumeMainSE(); audioEngine.Update(); engineSound2.Play(); if (engineSound2.IsStopped == true) { engineSound2.Dispose(); } else if (engineSound2.IsStopping == true) { engineSound2.Dispose(); } }
private void StopSoundMainSE(string se) { if (engineSound2 != null) { engineSound2 = soundBank2.GetCue(se); engineSound2.Stop(AudioStopOptions.AsAuthored); waveBank2.Dispose(); soundBank2.Dispose(); engineSound2.Dispose(); audioEngine.Update(); engineSound2 = null; } }
private void CloseSoundMain() { if (engineSound != null) { engineSound = soundBank.GetCue(bgmname); engineSound.Stop(AudioStopOptions.AsAuthored); waveBank.Dispose(); soundBank.Dispose(); engineSound.Dispose(); audioEngine.Update(); } }