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.

This commit is contained in:
Konstantin Koch 2015-01-03 19:17:49 +00:00 committed by Konstantin Koch
parent 629320a40b
commit 8e689b1fd8

View File

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