Пример #1
0
 public override SoundInput TryOpen(Stream file)
 {
     var header = new byte[0x1A];
     if (header.Length != file.Read (header, 0, header.Length))
         return null;
     if (!Binary.AsciiEqual (header, 0, "Creative Voice File\x1A"))
         return null;
     using (var reader = new VocReader (file, header))
     {
         var pcm = reader.ConvertToPcm();
         if (null == pcm)
             return null;
         return new RawPcmInput (pcm, reader.Format);
     }
 }
Пример #2
0
        public override SoundInput TryOpen(IBinaryStream file)
        {
            var header = file.ReadHeader(0x1A);

            if (!header.AsciiEqual("Creative Voice File\x1A"))
            {
                return(null);
            }
            using (var reader = new VocReader(file, header.ToArray()))
            {
                var pcm = reader.ConvertToPcm();
                if (null == pcm)
                {
                    return(null);
                }
                file.Dispose();
                return(new RawPcmInput(pcm, reader.Format));
            }
        }