From 8e689b1fd87497ab06bf861a4d63ae94a194a8e2 Mon Sep 17 00:00:00 2001 From: Konstantin Koch Date: Sat, 3 Jan 2015 19:17:49 +0000 Subject: [PATCH] fixed a bug with the song of the xaudio system where it wasn't able to read a file that contained spaces in the path. --- SoundSystems/ANX.SoundSystem.Windows.XAudio/XAudioSong.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SoundSystems/ANX.SoundSystem.Windows.XAudio/XAudioSong.cs b/SoundSystems/ANX.SoundSystem.Windows.XAudio/XAudioSong.cs index 838bd04e..ab6b31cd 100644 --- a/SoundSystems/ANX.SoundSystem.Windows.XAudio/XAudioSong.cs +++ b/SoundSystems/ANX.SoundSystem.Windows.XAudio/XAudioSong.cs @@ -34,7 +34,7 @@ namespace ANX.SoundSystem.Windows.XAudio public XAudioSong(XAudio2 device, Uri uri) { - filepath = uri.AbsolutePath.Replace("%20", ""); + filepath = Uri.UnescapeDataString(uri.AbsolutePath); this.device = device; // TODO: duration } @@ -55,6 +55,7 @@ namespace ANX.SoundSystem.Windows.XAudio PlayPosition = TimeSpan.Zero; State = MediaState.Stopped; + //TODO: Provide a Metro implementation. #if !WINDOWSMETRO oggFileStream = File.Open(filepath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); oggStream = new XAudioOggInputStream(oggFileStream);