diff --git a/ArcFormats/ArcCommon.cs b/ArcFormats/ArcCommon.cs index e80f33a0..8e349be1 100644 --- a/ArcFormats/ArcCommon.cs +++ b/ArcFormats/ArcCommon.cs @@ -63,8 +63,8 @@ namespace GameRes.Formats { if (0 == signature) return null; // resolve some special cases first - if (s_OggFormat.Value.Signature == signature) - return s_OggFormat.Value; + if (OggAudio.Instance.Signature == signature) + return OggAudio.Instance; if (AudioFormat.Wav.Signature == signature) return AudioFormat.Wav; if (0x4D42 == (signature & 0xFFFF)) // 'BM' diff --git a/ArcFormats/AudioOGG.cs b/ArcFormats/AudioOGG.cs index f28e5dbc..52696198 100644 --- a/ArcFormats/AudioOGG.cs +++ b/ArcFormats/AudioOGG.cs @@ -26,6 +26,7 @@ using System; using System.ComponentModel.Composition; using System.IO; +using System.Linq; using NVorbis; namespace GameRes.Formats @@ -133,5 +134,9 @@ namespace GameRes.Formats { return new OggInput (file); } + + public static AudioFormat Instance { get { return s_OggFormat.Value; } } + + static readonly Lazy s_OggFormat = new Lazy (() => FormatCatalog.Instance.AudioFormats.FirstOrDefault (x => x.Tag == "OGG")); } } diff --git a/ArcFormats/BlackCyc/AudioVAW.cs b/ArcFormats/BlackCyc/AudioVAW.cs index 5010e565..a76424d0 100644 --- a/ArcFormats/BlackCyc/AudioVAW.cs +++ b/ArcFormats/BlackCyc/AudioVAW.cs @@ -44,8 +44,6 @@ namespace GameRes.Formats.BlackCyc Extensions = new string[] { "vaw", "wgq" }; } - static readonly Lazy OggFormat = new Lazy (() => FormatCatalog.Instance.AudioFormats.FirstOrDefault (x => x.Tag == "OGG")); - public override SoundInput TryOpen (Stream file) { var header = ResourceHeader.Read (file); @@ -64,12 +62,12 @@ namespace GameRes.Formats.BlackCyc } else if (2 == header.PackType) { - format = OggFormat.Value; + format = OggAudio.Instance; offset = 0x6C; } else if (6 == header.PackType && Binary.AsciiEqual (header.Bytes, 0x10, "OGG ")) { - format = OggFormat.Value; + format = OggAudio.Instance; offset = 0x40; } else