Skip to content

Commit b52b2a0

Browse files
committed
Fix open audio file only once
Signed-off-by: Florian Grabmeier <[email protected]>
1 parent 9d5f74c commit b52b2a0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ public MainWindow(Settings settings, MainViewModel mainVM)
4949
_settings = settings;
5050

5151
InitializeComponent();
52-
InitializePosition();
52+
InitializePosition();
53+
54+
animationSound.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav"));
5355
}
5456

5557
public MainWindow()
@@ -112,7 +114,7 @@ private void OnLoaded(object sender, RoutedEventArgs _)
112114
{
113115
if (_settings.UseSound)
114116
{
115-
animationSound.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav"));
117+
animationSound.Position = TimeSpan.Zero;
116118
animationSound.Volume = _settings.SoundVolume / 100.0;
117119
animationSound.Play();
118120
}

0 commit comments

Comments
 (0)