public VorbisReader(Stream stream, bool closeStreamOnDispose) : this() { var bufferedStream = new BufferedReadStream(stream); bufferedStream.CloseBaseStream = closeStreamOnDispose; // try Ogg first var oggContainer = new Ogg.ContainerReader(bufferedStream, closeStreamOnDispose); if (!LoadContainer(oggContainer)) { // oops, not Ogg! // we don't support any other container types yet, so error out bufferedStream.Close(); throw new InvalidDataException("Could not determine container type!"); } _containerReader = oggContainer; if (_decoders.Count == 0) throw new InvalidDataException("No Vorbis data found!"); }
public VorbisReader(Stream stream, bool closeStreamOnDispose) : this() { BufferedReadStream bufferedReadStream = new BufferedReadStream(stream) { CloseBaseStream = closeStreamOnDispose }; ContainerReader containerReader = new ContainerReader(bufferedReadStream, closeStreamOnDispose); if (!LoadContainer(containerReader)) { bufferedReadStream.Dispose(); throw new InvalidDataException("Could not determine container type!"); } _containerReader = containerReader; if (_decoders.Count == 0) { throw new InvalidDataException("No Vorbis data found!"); } }
public VorbisReader(Stream stream, bool closeStreamOnDispose) : this() { var bufferedStream = new BufferedReadStream(stream); bufferedStream.CloseBaseStream = closeStreamOnDispose; // try Ogg first var oggContainer = new Ogg.ContainerReader(bufferedStream, closeStreamOnDispose); if (!LoadContainer(oggContainer)) { // oops, not Ogg! // we don't support any other container types yet, so error out bufferedStream.Close(); throw new InvalidDataException("Could not determine container type!"); } _containerReader = oggContainer; if (_decoders.Count == 0) { throw new InvalidDataException("No Vorbis data found!"); } }