mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 03:44:13 +08:00
(WaveAudio): store ogg/mp3 format tags in a set.
This commit is contained in:
parent
68832d9544
commit
382b257532
@ -105,11 +105,15 @@ namespace GameRes
|
|||||||
public override string Description { get { return "Wave audio format"; } }
|
public override string Description { get { return "Wave audio format"; } }
|
||||||
public override uint Signature { get { return 0x46464952; } } // 'RIFF'
|
public override uint Signature { get { return 0x46464952; } } // 'RIFF'
|
||||||
|
|
||||||
|
static readonly HashSet<ushort> EmbeddedFormats = new HashSet<ushort> {
|
||||||
|
0x674f, 0x6751, 0x6771, // Vorbis
|
||||||
|
0x0055, // MpegLayer3
|
||||||
|
};
|
||||||
|
|
||||||
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 // Vorbis
|
if (EmbeddedFormats.Contains (sound.Format.FormatTag))
|
||||||
|| 0x0055 == sound.Format.FormatTag) // MpegLayer3
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user