public WAV(byte[] file) { EndianBinaryReader er = new EndianBinaryReader((Stream) new MemoryStream(file), Endianness.LittleEndian); bool OK; this.Header = new DataBlockHeader(er, "RIFF", out OK); if (!OK) { int num1 = (int)MessageBox.Show("Error 1"); } else { this.Wave = new WAV.WaveData(er, out OK); if (!OK) { int num2 = (int)MessageBox.Show("Error 2"); } } er.Close(); }
public WAV(byte[] Data, uint SampleRate, ushort BitsPerSample, ushort NrChannel) { this.Header = new DataBlockHeader("RIFF", (uint)(36 + Data.Length)); this.Wave = new WAV.WaveData(Data, SampleRate, BitsPerSample, NrChannel); }