From 8d7d06e1ac9c1c2f4eff667dee471434d1421c6c Mon Sep 17 00:00:00 2001 From: morkt Date: Tue, 21 Nov 2017 12:13:42 +0400 Subject: [PATCH] (GUI): convert wave audio providers to ISampleProvider. avoids audio clicking at the end of playback. --- GUI/MainWindow.xaml.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/GUI/MainWindow.xaml.cs b/GUI/MainWindow.xaml.cs index 21d5f497..ff43a42b 100644 --- a/GUI/MainWindow.xaml.cs +++ b/GUI/MainWindow.xaml.cs @@ -987,7 +987,10 @@ namespace GARbro.GUI } CurrentAudio = new WaveStreamImpl (sound); AudioDevice = new WaveOutEvent(); - AudioDevice.Init (CurrentAudio); + if ("wav" == sound.SourceFormat) + AudioDevice.Init (CurrentAudio.ToSampleProvider()); + else + AudioDevice.Init (CurrentAudio); AudioDevice.PlaybackStopped += OnPlaybackStopped; AudioDevice.Play(); input = null;