From b52b2a06228b353d3b2bbad652ee858793f3dac3 Mon Sep 17 00:00:00 2001 From: Florian Grabmeier Date: Wed, 17 Jan 2024 10:21:14 +0100 Subject: [PATCH] Fix open audio file only once Signed-off-by: Florian Grabmeier --- Flow.Launcher/MainWindow.xaml.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 70765c1dc..b745eaee7 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -49,7 +49,9 @@ namespace Flow.Launcher _settings = settings; InitializeComponent(); - InitializePosition(); + InitializePosition(); + + animationSound.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav")); } public MainWindow() @@ -112,7 +114,7 @@ namespace Flow.Launcher { if (_settings.UseSound) { - animationSound.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav")); + animationSound.Position = TimeSpan.Zero; animationSound.Volume = _settings.SoundVolume / 100.0; animationSound.Play(); }