migration to IBinaryStream interface.

This commit is contained in:
morkt
2016-10-15 09:34:46 +04:00
parent 0b96ef8f77
commit 503b734645
16 changed files with 264 additions and 332 deletions

View File

@@ -111,17 +111,18 @@ namespace GameRes
0x0055, // MpegLayer3
};
public override SoundInput TryOpen (Stream file)
public override SoundInput TryOpen (IBinaryStream file)
{
SoundInput sound = new WaveInput (file);
SoundInput sound = new WaveInput (file.AsStream);
if (EmbeddedFormats.Contains (sound.Format.FormatTag))
{
var bin = new BinaryStream (sound, file.Name);
try
{
var embedded = AudioFormat.Read (sound);
var embedded = AudioFormat.Read (bin);
if (null != embedded)
{
sound.Dispose();
// sound.Dispose();
sound = embedded;
}
}