Report unknown codecs when failing
This commit is contained in:
@@ -43,7 +43,6 @@ namespace OpenRA.FileFormats
|
|||||||
Format = s.ReadASCII(4);
|
Format = s.ReadASCII(4);
|
||||||
if (Format != "WAVE")
|
if (Format != "WAVE")
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
while (s.Position < s.Length)
|
while (s.Position < s.Length)
|
||||||
{
|
{
|
||||||
if ((s.Position & 1) == 1)
|
if ((s.Position & 1) == 1)
|
||||||
@@ -57,8 +56,8 @@ namespace OpenRA.FileFormats
|
|||||||
AudioFormat = s.ReadInt16();
|
AudioFormat = s.ReadInt16();
|
||||||
Type = (WaveType)AudioFormat;
|
Type = (WaveType)AudioFormat;
|
||||||
|
|
||||||
if (Type != WaveType.Pcm && Type != WaveType.ImaAdpcm)
|
if (!Enum.IsDefined(typeof(WaveType), Type))
|
||||||
throw new NotSupportedException("Compression type is not supported.");
|
throw new NotSupportedException("Compression type {0} is not supported.".F(AudioFormat));
|
||||||
|
|
||||||
Channels = s.ReadInt16();
|
Channels = s.ReadInt16();
|
||||||
SampleRate = s.ReadInt32();
|
SampleRate = s.ReadInt32();
|
||||||
|
|||||||
Reference in New Issue
Block a user