public FMTBlock(uint SampleRate, ushort BitsPerSample, ushort NrChannel) { this.Header = new DataBlockHeader("fmt ", 16U); this.AudioFormat = WAV.WaveData.FMTBlock.WaveFormat.WAVE_FORMAT_PCM; this.NrChannel = NrChannel; this.SampleRate = SampleRate; this.BitsPerSample = BitsPerSample; this.ByteRate = SampleRate * (uint)BitsPerSample * (uint)NrChannel / 8U; this.BlockAlign = (ushort)((int)NrChannel * (int)BitsPerSample / 8); }
public FMTBlock(EndianBinaryReader er, out bool OK) { bool OK1; this.Header = new DataBlockHeader(er, "fmt ", out OK1); if (!OK1) { OK = false; } else { this.AudioFormat = (WAV.WaveData.FMTBlock.WaveFormat)er.ReadUInt16(); this.NrChannel = er.ReadUInt16(); this.SampleRate = er.ReadUInt32(); this.ByteRate = er.ReadUInt32(); this.BlockAlign = er.ReadUInt16(); this.BitsPerSample = er.ReadUInt16(); OK = true; } }