protected virtual void LoadHeader() { _mmc = MMChunk.FromStream(_baseStream); _ckFmt = _mmc.FindChunk(FourCC.Fmt) as FmtChunk; if (_ckFmt != null) { _fmt = _ckFmt.WaveFormat; } _ckData = _mmc.FindChunk(FourCC.Data) as DataChunk; if (_ckData != null) { _posData = _ckData.DataStart; } _baseStream.Seek(_posData, SeekOrigin.Begin); }
public override void LoadFromStream(Stream st) { byte[] data = new byte[4]; m_posStart = st.Position - 4; st.Read(data, 0, 4); m_nSize = BitConverter.ToInt32(data, 0); st.Read(data, 0, 4); if (Encoding.ASCII.GetString(data, 0, 4) != "WAVE") { throw new InvalidOperationException("Must have WAVE format"); } while (st.Position - m_posStart != m_nSize + 8) { MMChunk ck = MMChunk.FromStream(st); if (ck == null) { break; } m_chunkList.Add(ck); } }