Example #1
0
        public WaveOverFlacStream(FlacReader reader)
        {
            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }

            this.dataSource = ReadFlac(reader);
            this.mode       = WaveOverFlacStreamMode.Decode;
        }
Example #2
0
        public WaveOverFlacStream(FlacStreaminfo info, Stream Body)
        {
            if (Body == null)
            {
                throw new ArgumentNullException("reader");
            }

            this.dataSource = ReadFlacSpliter(info, Body);
            this.mode       = WaveOverFlacStreamMode.Decode;
        }
Example #3
0
        public WaveOverFlacStream(FlacWriter writer, int compressionLevel)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            ValidateCompressionLevel(compressionLevel);

            this.dataConsumer = WriteFlac(writer, compressionLevel);
            this.dataConsumer.MoveNext();
            this.mode = WaveOverFlacStreamMode.Encode;
        }
Example #4
0
        public WaveOverFlacStream(Stream stream, WaveOverFlacStreamMode mode, bool leaveOpen, int compressionLevel)
        {
            if (stream == null) throw new ArgumentNullException("stream");
            ValidateCompressionLevel(compressionLevel);

            this.mode = mode;
            switch (mode)
            {
                case WaveOverFlacStreamMode.Decode:
                    this.dataSource = ReadFlac(new FlacReader(stream, leaveOpen)); break;
                case WaveOverFlacStreamMode.Encode:
                    this.dataConsumer = WriteFlac(new FlacWriter(stream, leaveOpen), compressionLevel);
                    this.dataConsumer.MoveNext();
                    break;
            }
        }
Example #5
0
        public WaveOverFlacStream(Stream stream, WaveOverFlacStreamMode mode, bool leaveOpen, int compressionLevel)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }
            ValidateCompressionLevel(compressionLevel);

            this.mode = mode;
            switch (mode)
            {
            case WaveOverFlacStreamMode.Decode:
                this.dataSource = ReadFlac(new FlacReader(stream, leaveOpen)); break;

            case WaveOverFlacStreamMode.Encode:
                this.dataConsumer = WriteFlac(new FlacWriter(stream, leaveOpen), compressionLevel);
                this.dataConsumer.MoveNext();
                break;
            }
        }
Example #6
0
 public WaveOverFlacStream(Stream stream, WaveOverFlacStreamMode mode, bool leaveOpen)
     : this(stream, mode, leaveOpen, FlacWriter.DefaultEncodingPolicyLevel)
 {
 }
Example #7
0
 public WaveOverFlacStream(Stream stream, WaveOverFlacStreamMode mode)
     : this(stream, mode, false, FlacWriter.DefaultEncodingPolicyLevel)
 {
 }
Example #8
0
 public WaveOverFlacStream(Stream stream, WaveOverFlacStreamMode mode, bool leaveOpen)
     : this(stream, mode, leaveOpen, FlacWriter.DefaultEncodingPolicyLevel)
 {
 }
Example #9
0
 public WaveOverFlacStream(Stream stream, WaveOverFlacStreamMode mode)
     : this(stream, mode, false, FlacWriter.DefaultEncodingPolicyLevel)
 {
 }
Example #10
0
        public WaveOverFlacStream(FlacWriter writer, int compressionLevel)
        {
            if (writer == null) throw new ArgumentNullException("writer");
            ValidateCompressionLevel(compressionLevel);

            this.dataConsumer = WriteFlac(writer, compressionLevel);
            this.dataConsumer.MoveNext();
            this.mode = WaveOverFlacStreamMode.Encode;
        }
Example #11
0
        public WaveOverFlacStream(FlacReader reader)
        {
            if (reader == null) throw new ArgumentNullException("reader");

            this.dataSource = ReadFlac(reader);
            this.mode = WaveOverFlacStreamMode.Decode;
            EnsureHeaderRead();
        }