(AOG): another version.

This commit is contained in:
morkt 2018-12-02 19:33:48 +04:00
parent fada8e0b40
commit 5bc2d0ff45

View File

@ -38,10 +38,16 @@ namespace GameRes.Formats.Aoi
public override SoundInput TryOpen (IBinaryStream file) public override SoundInput TryOpen (IBinaryStream file)
{ {
var header = file.ReadHeader (0x30); var header = file.ReadHeader (0x3C);
if (!header.AsciiEqual (0, "AoiOgg") || !header.AsciiEqual (0x2C, "OggS")) 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; return null;
var ogg = new StreamRegion (file.AsStream, 0x2C);
return new OggInput (ogg); return new OggInput (ogg);
} }
} }