From 04cda69ef9b27ae8f0afdc0c62767d4be40a350c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 19 Dec 2020 11:03:07 +0100 Subject: [PATCH] This compression is actually not yet supported. --- OpenRA.Mods.Cnc/AudioLoaders/AudLoader.cs | 2 +- OpenRA.Mods.Cnc/FileFormats/AudReader.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Cnc/AudioLoaders/AudLoader.cs b/OpenRA.Mods.Cnc/AudioLoaders/AudLoader.cs index 3cad70667f..5d652df4ce 100644 --- a/OpenRA.Mods.Cnc/AudioLoaders/AudLoader.cs +++ b/OpenRA.Mods.Cnc/AudioLoaders/AudLoader.cs @@ -24,7 +24,7 @@ namespace OpenRA.Mods.Cnc.AudioLoaders var readFormat = s.ReadByte(); s.Position = start; - return Enum.IsDefined(typeof(SoundFormat), readFormat); + return readFormat == (int)SoundFormat.ImaAdpcm; } bool ISoundLoader.TryParseSound(Stream stream, out ISoundFormat sound) diff --git a/OpenRA.Mods.Cnc/FileFormats/AudReader.cs b/OpenRA.Mods.Cnc/FileFormats/AudReader.cs index 977df37b78..0a77c9f885 100644 --- a/OpenRA.Mods.Cnc/FileFormats/AudReader.cs +++ b/OpenRA.Mods.Cnc/FileFormats/AudReader.cs @@ -66,6 +66,9 @@ namespace OpenRA.Mods.Cnc.FileFormats if (!Enum.IsDefined(typeof(SoundFormat), readFormat)) return false; + if (readFormat == (int)SoundFormat.WestwoodCompressed) + throw new NotImplementedException(); + var offsetPosition = s.Position; result = () =>