Ejemplo n.º 1
0
 protected WaveDataChunk(RiffParser parser, BinaryReader reader) : base(reader)
 {
     if (parser.ReadDataChunk)
     {
         Data = reader.ReadBytes(SubChunkSize);
     }
 }
Ejemplo n.º 2
0
        protected WaveFmtChunk(RiffParser parser, BinaryReader reader) : base(reader)
        {
            FormatTag      = reader.ReadUInt16();
            ChannelCount   = reader.ReadInt16();
            SampleRate     = reader.ReadInt32();
            AvgBytesPerSec = reader.ReadInt32();
            BlockAlign     = reader.ReadInt16();
            BitsPerSample  = reader.ReadInt16();

            if (FormatTag == WaveFormatTags.WaveFormatExtensible && parser.FormatExtensibleParser != null)
            {
                long startOffset = reader.BaseStream.Position + 2;
                Ext = parser.FormatExtensibleParser(parser, reader);

                long endOffset      = startOffset + Ext.Size;
                int  remainingBytes = (int)Math.Max(endOffset - reader.BaseStream.Position, 0);
                Ext.Extra = reader.ReadBytes(remainingBytes);
            }
        }
Ejemplo n.º 3
0
 public static WaveFmtChunk Parse(RiffParser parser, BinaryReader reader) => new WaveFmtChunk(parser, reader);
Ejemplo n.º 4
0
 public static WaveSmplChunk Parse(RiffParser parser, BinaryReader reader) => new WaveSmplChunk(reader);