(WaveAudio): recognize mp3-tagged streams.

This commit is contained in:
morkt 2015-05-15 17:33:08 +04:00
parent a313a32c03
commit 8f77fde7d5

View File

@ -101,15 +101,16 @@ namespace GameRes
public override SoundInput TryOpen (Stream file) public override SoundInput TryOpen (Stream file)
{ {
SoundInput sound = new WaveInput (file); SoundInput sound = new WaveInput (file);
if (0x674f == sound.Format.FormatTag || 0x6771 == sound.Format.FormatTag) if (0x674f == sound.Format.FormatTag || 0x6771 == sound.Format.FormatTag // Vorbis
|| 0x0055 == sound.Format.FormatTag) // MpegLayer3
{ {
try try
{ {
var ogg = AudioFormat.Read (sound); var embedded = AudioFormat.Read (sound);
if (null != ogg) if (null != embedded)
{ {
sound.Dispose(); sound.Dispose();
sound = ogg; sound = embedded;
} }
} }
catch { /* ignore errors */ } catch { /* ignore errors */ }