private void buttonBrowsePauseSound_Click(object sender, EventArgs e) { if (openFileDialogPause.ShowDialog() == DialogResult.OK) { //Try opening the file try { string extension = Path.GetExtension(openFileDialogPause.FileName); switch (extension) { /*case ".wav": * PauseSound = new CachedVorbisSound(openFileDialogPause.FileName); * break; * case ".aiff": * PauseSound = new CachedVorbisSound(openFileDialogPause.FileName); * break; * case ".mp3": * PauseSound = new CachedVorbisSound(openFileDialogPause.FileName); * break;*/ case ".ogg": PauseSound = new CachedVorbisSound(openFileDialogPause.FileName); break; /*case ".flac": * PauseSound = new CachedVorbisSound(openFileDialogPause.FileName); * break;*/ default: ResetPauseSound(); return; } } catch (Exception) { ResetPauseSound(); return; } //If we got to here, it opened successfully labelPauseSound.Text = "Pause sound: " + Path.GetFileName(openFileDialogPause.FileName); LogMessage("Pause sound is set to " + Path.GetFullPath(openFileDialogPause.FileName) + ". This sound will play when playback pauses", Color.LightSkyBlue); Mixer.PlaySound(PauseSound); } else { ResetPauseSound(); return; } }
public void PlaySound(CachedVorbisSound sound) { AddMixerInput(new CachedSoundSampleProvider(sound)); }
public CachedSoundSampleProvider(CachedVorbisSound cachedSound) { this.cachedSound = cachedSound; }