From 5bc2d0ff45a66922ef01a7c1e486d755624c7226 Mon Sep 17 00:00:00 2001 From: morkt Date: Sun, 2 Dec 2018 19:33:48 +0400 Subject: [PATCH] (AOG): another version. --- ArcFormats/Aoi/AudioAOG.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ArcFormats/Aoi/AudioAOG.cs b/ArcFormats/Aoi/AudioAOG.cs index 20a788ee..17fd360a 100644 --- a/ArcFormats/Aoi/AudioAOG.cs +++ b/ArcFormats/Aoi/AudioAOG.cs @@ -38,10 +38,16 @@ namespace GameRes.Formats.Aoi public override SoundInput TryOpen (IBinaryStream file) { - var header = file.ReadHeader (0x30); - if (!header.AsciiEqual (0, "AoiOgg") || !header.AsciiEqual (0x2C, "OggS")) + var header = file.ReadHeader (0x3C); + if (!header.AsciiEqual (0, "AoiOgg")) + return null; + Stream ogg; + if (header.AsciiEqual (0x2C, "OggS")) + ogg = new StreamRegion (file.AsStream, 0x2C); + else if (header.AsciiEqual (0xC, "Decode") && header.AsciiEqual (0x38, "OggS")) + ogg = new StreamRegion (file.AsStream, 0x38); + else return null; - var ogg = new StreamRegion (file.AsStream, 0x2C); return new OggInput (ogg); } }