diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index a465345be..a2d0eedfe 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -25,6 +25,8 @@ using System.Windows.Data; using ModernWpf.Controls; using Key = System.Windows.Input.Key; using System.Threading; +using System.Media; + namespace Flow.Launcher { @@ -38,8 +40,8 @@ namespace Flow.Launcher private NotifyIcon _notifyIcon; private ContextMenu contextMenu; private MainViewModel _viewModel; - private readonly MediaPlayer animationSound = new(); private bool _animating; + SoundPlayer animationSound = new SoundPlayer(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav"); #endregion @@ -50,8 +52,7 @@ namespace Flow.Launcher _settings = settings; InitializeComponent(); - InitializePosition(); - animationSound.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav")); + InitializePosition(); } public MainWindow() @@ -115,7 +116,6 @@ namespace Flow.Launcher { if (_settings.UseSound) { - animationSound.Position = TimeSpan.Zero; animationSound.Play(); } UpdatePosition();