Example #1
0
            public RiffSubchunk_fmt(RiffSubchunk origin)
            {
                tag = "fmt ";
                BinaryReader br = new BinaryReader(new MemoryStream(origin.ReadAll()));

                format_tag     = (FORMAT_TAG)br.ReadUInt16();
                channels       = br.ReadUInt16();
                samplesPerSec  = br.ReadUInt32();
                avgBytesPerSec = br.ReadUInt32();
                blockAlign     = br.ReadUInt16();
                bitsPerSample  = br.ReadUInt16();
            }
Example #2
0
 public RiffContainer_INFO(RiffContainer rc)
 {
     subchunks = rc.subchunks;
     type      = "INFO";
     foreach (RiffChunk chunk in subchunks)
     {
         RiffSubchunk rsc = chunk as RiffSubchunk;
         if (chunk == null)
         {
             throw new FormatException("Invalid subchunk of INFO list");
         }
         dictionary[rsc.tag] = System.Text.Encoding.ASCII.GetString(rsc.ReadAll());
     }
 }
Example #3
0
 /// <exception cref="FormatException"><paramref name="rc"/>.<see cref="RiffContainer.subchunks"/> contains a chunk that does not inherit <see cref="RiffSubchunk"/></exception>
 public RiffContainer_INFO(RiffContainer rc)
 {
     subchunks = rc.subchunks;
     type      = "INFO";
     foreach (RiffChunk chunk in subchunks)
     {
         RiffSubchunk rsc = chunk as RiffSubchunk;
         if (chunk == null)
         {
             throw new FormatException("Invalid subchunk of INFO list");                                    //TODO is this supposed to be a check on `rsc` (i.e. as a type check)? --yoshi
         }
         dictionary[rsc.tag] = System.Text.Encoding.ASCII.GetString(rsc.ReadAll());
     }
 }
Example #4
0
			public RiffSubchunk_fmt(RiffSubchunk origin)
			{
				tag = "fmt ";
				BinaryReader br = new BinaryReader(new MemoryStream(origin.ReadAll()));
				format_tag = (FORMAT_TAG)br.ReadUInt16();
				channels = br.ReadUInt16();
				samplesPerSec = br.ReadUInt32();
				avgBytesPerSec = br.ReadUInt32();
				blockAlign = br.ReadUInt16();
				bitsPerSample = br.ReadUInt16();
			}