(GUI): convert wave audio providers to ISampleProvider.

avoids audio clicking at the end of playback.
This commit is contained in:
morkt 2017-11-21 12:13:42 +04:00
parent a1f3db374e
commit 8d7d06e1ac

View File

@ -987,7 +987,10 @@ namespace GARbro.GUI
} }
CurrentAudio = new WaveStreamImpl (sound); CurrentAudio = new WaveStreamImpl (sound);
AudioDevice = new WaveOutEvent(); AudioDevice = new WaveOutEvent();
AudioDevice.Init (CurrentAudio); if ("wav" == sound.SourceFormat)
AudioDevice.Init (CurrentAudio.ToSampleProvider());
else
AudioDevice.Init (CurrentAudio);
AudioDevice.PlaybackStopped += OnPlaybackStopped; AudioDevice.PlaybackStopped += OnPlaybackStopped;
AudioDevice.Play(); AudioDevice.Play();
input = null; input = null;