Merge pull request #10482 from Mailaender/ra2-wav

Fixed crashes with Red Alert 2 wav files
This commit is contained in:
Paul Chote
2016-01-15 23:05:13 +00:00
5 changed files with 40 additions and 32 deletions

View File

@@ -63,11 +63,8 @@ namespace OpenRA
int sampleBits;
int sampleRate;
foreach (var loader in Game.ModData.SoundLoaders)
{
stream.Position = 0;
if (loader.TryParseSound(stream, filename, out rawData, out channels, out sampleBits, out sampleRate))
return soundEngine.AddSoundSourceFromMemory(rawData, channels, sampleBits, sampleRate);
}
throw new InvalidDataException(filename + " is not a valid sound file!");
}