示例#1
0
        public VorbisReader(IPacketProvider packetProvider)
            : this()
        {
            var ea = new NewStreamEventArgs(packetProvider);

            NewStream(this, ea);
            if (ea.IgnoreStream)
            {
                throw new InvalidDataException("No Vorbis data found!");
            }
        }
示例#2
0
        void NewStream(object sender, NewStreamEventArgs ea)
        {
            var packetProvider = ea.PacketProvider;
            var decoder        = new VorbisStreamDecoder(packetProvider);

            if (decoder.TryInit())
            {
                _decoders.Add(decoder);
                _serials.Add(packetProvider.StreamSerial);
            }
            else
            {
                // This is almost certainly not a Vorbis stream
                ea.IgnoreStream = true;
            }
        }