#nullable enable using System; using System.Media; using System.Windows; namespace ReminderOrganizer.Services { /// Plays the reminder chime (Assets/reminder.wav, embedded as WPF resource). public static class SoundService { private static SoundPlayer? _player; public static void PlayReminder() { try { if (_player == null) { var res = Application.GetResourceStream(new Uri("pack://application:,,,/Assets/reminder.wav")); if (res == null) { SystemSounds.Asterisk.Play(); return; } _player = new SoundPlayer(res.Stream); _player.Load(); } _player.Play(); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine($"[Sound] {ex.Message}"); } } } }