Fix open audio file only once

Signed-off-by: Florian Grabmeier <flo.grabmeier@gmail.com>
This commit is contained in:
Florian Grabmeier 2024-01-17 10:21:14 +01:00
parent 9d5f74ca8f
commit b52b2a0622

View file

@ -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();
}