/// <summary> /// Plays some standard sounds. /// </summary> /// <param name="sound">The sound.</param> /// <returns>True if the file could be played</returns> public bool PlayWave(StandardSounds sound) { //TODO: set the path generic string path = @"C:/Windows/media/"; switch (sound) { case StandardSounds.None: return(false); case StandardSounds.Error: path += "Windows Error.wav"; break; case StandardSounds.Critical: path += "Windows Critical Stop.wav"; break; case StandardSounds.End: path += "Windows Balloon.wav"; break; case StandardSounds.Ping: path += "Windows Ding.wav"; break; case StandardSounds.Start: path += "Windows Logon Sound.wav"; break; case StandardSounds.Stop: path += "Windows Logoff Sound.wav"; break; case StandardSounds.Notify: path += "Windows Notify.wav"; break; case StandardSounds.Info: path += "Windows Information Bar.wav"; break; default: return(false); } return(PlayWave(path)); }
/// <summary> /// Plays some standard sounds and stops all other sounds. /// </summary> /// <param name="sound">The sound.</param> /// <returns>True if the file could be played</returns> public bool PlayWaveImmediately(StandardSounds sound) { AbortSound(); return(PlayWave(sound)); }