From 382b257532ff149274e98c8d34ed002ac89f6dc1 Mon Sep 17 00:00:00 2001 From: morkt Date: Wed, 4 Nov 2015 04:02:42 +0400 Subject: [PATCH] (WaveAudio): store ogg/mp3 format tags in a set. --- GameRes/AudioWAV.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/GameRes/AudioWAV.cs b/GameRes/AudioWAV.cs index 3aa1e44c..165f529d 100644 --- a/GameRes/AudioWAV.cs +++ b/GameRes/AudioWAV.cs @@ -105,11 +105,15 @@ namespace GameRes public override string Description { get { return "Wave audio format"; } } public override uint Signature { get { return 0x46464952; } } // 'RIFF' + static readonly HashSet EmbeddedFormats = new HashSet { + 0x674f, 0x6751, 0x6771, // Vorbis + 0x0055, // MpegLayer3 + }; + public override SoundInput TryOpen (Stream file) { SoundInput sound = new WaveInput (file); - if (0x674f == sound.Format.FormatTag || 0x6771 == sound.Format.FormatTag // Vorbis - || 0x0055 == sound.Format.FormatTag) // MpegLayer3 + if (EmbeddedFormats.Contains (sound.Format.FormatTag)) { try {