Report unknown codecs when failing

This commit is contained in:
Matthias Mailänder
2016-01-13 12:02:12 +01:00
parent fb39aed29f
commit 71e8e20987

View File

@@ -43,7 +43,6 @@ namespace OpenRA.FileFormats
Format = s.ReadASCII(4);
if (Format != "WAVE")
return false;
while (s.Position < s.Length)
{
if ((s.Position & 1) == 1)
@@ -57,8 +56,8 @@ namespace OpenRA.FileFormats
AudioFormat = s.ReadInt16();
Type = (WaveType)AudioFormat;
if (Type != WaveType.Pcm && Type != WaveType.ImaAdpcm)
throw new NotSupportedException("Compression type is not supported.");
if (!Enum.IsDefined(typeof(WaveType), Type))
throw new NotSupportedException("Compression type {0} is not supported.".F(AudioFormat));
Channels = s.ReadInt16();
SampleRate = s.ReadInt32();