Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RiffChunk"/> class.
 /// </summary>
 /// <param name="stream">The stream holding this chunk</param>
 /// <param name="type">The type.</param>
 /// <param name="size">The size.</param>
 /// <param name="dataPosition">The data offset.</param>
 /// <param name="isList">if set to <c>true</c> [is list].</param>
 /// <param name="isHeader">if set to <c>true</c> [is header].</param>
 public RiffChunk(Stream stream, FourCC type, uint size, uint dataPosition, bool isList = false, bool isHeader = false)
 {
     Stream       = stream;
     Type         = type;
     Size         = size;
     DataPosition = dataPosition;
     IsList       = isList;
     IsHeader     = isHeader;
 }
Beispiel #2
0
 public RiffChunk(Stream stream, FourCC type, uint size, uint dataPosition, bool isList = false, bool isHeader = false)
 {
     this.Stream       = stream;
     this.Type         = type;
     this.Size         = size;
     this.DataPosition = dataPosition;
     this.IsList       = isList;
     this.IsHeader     = isHeader;
 }
Beispiel #3
0
        public void Begin(WaveFormat waveFormat)
        {
            if (this.isBegin)
            {
                throw new InvalidOperationException("Cannot begin a new WAV while another begin has not been closed");
            }
            this.serializer.BeginChunk((FourCC)"RIFF");
            FourCC fourCc = new FourCC("WAVE");

            this.serializer.Serialize <FourCC>(ref fourCc, SerializeFlags.Normal);
            this.serializer.BeginChunk((FourCC)"fmt ");
            this.serializer.Serialize <WaveFormat>(ref waveFormat, SerializeFlags.Normal);
            this.serializer.EndChunk();
            this.serializer.BeginChunk((FourCC)"data");
            this.isBegin = true;
        }
Beispiel #4
0
        public void Begin(WaveFormat waveFormat)
        {
            if (isBegin)
            {
                throw new InvalidOperationException("Cannot begin a new WAV while another begin has not been closed");
            }

            serializer.BeginChunk("RIFF");
            var fourCC = new FourCC("WAVE");

            serializer.Serialize(ref fourCC);

            serializer.BeginChunk("fmt ");
            serializer.Serialize(ref waveFormat);
            serializer.EndChunk();

            serializer.BeginChunk("data");
            isBegin = true;
        }