diff --git a/OpenRA.FileFormats/FileFormats/AudLoader.cs b/OpenRA.FileFormats/FileFormats/AudLoader.cs index bf9a06410b..fe3abca8fe 100644 --- a/OpenRA.FileFormats/FileFormats/AudLoader.cs +++ b/OpenRA.FileFormats/FileFormats/AudLoader.cs @@ -76,7 +76,7 @@ namespace OpenRA.FileFormats return (short)current; } - public static byte[] LoadSound(byte[] raw) + public static byte[] LoadSound(byte[] raw, ref int index) { var br = new BinaryReader(new MemoryStream(raw)); var dataSize = raw.Length; @@ -84,7 +84,6 @@ namespace OpenRA.FileFormats var output = new byte[outputSize]; var offset = 0; - var index = 0; var currentSample = 0; while (dataSize-- > 0) diff --git a/OpenRA.FileFormats/Graphics/VqaReader.cs b/OpenRA.FileFormats/Graphics/VqaReader.cs index a38f140f89..91694e6dc8 100644 --- a/OpenRA.FileFormats/Graphics/VqaReader.cs +++ b/OpenRA.FileFormats/Graphics/VqaReader.cs @@ -132,7 +132,7 @@ namespace OpenRA.FileFormats // Don't parse sound (yet); skip data { var rawAudio = reader.ReadBytes((int)length); - audioData = AudLoader.LoadSound(rawAudio); + audioData = AudLoader.LoadSound(rawAudio, ref adpcmIndex); } break; case "VQFR": @@ -147,7 +147,9 @@ namespace OpenRA.FileFormats } if (++currentFrame == Frames) currentFrame = cbOffset = cbChunk = 0; - } + } + + int adpcmIndex = 0; // VQA Frame public void DecodeVQFR(BinaryReader reader)