public static wavFormat Read(BinaryReader reader) { wavFormat rv = new wavFormat(); rv.read(reader); return(rv); }
private void clear() { header = null; format = null; data = null; FileName = null; Name = null; }
public Wav(Wav copy) { header = new wavHeader(copy.header); format = new wavFormat(copy.format); data = new wavData(copy.data); OrigDuration = copy.OrigDuration; FileName = copy.FileName; Name = copy.Name; }
public wavFormat(wavFormat copy) { dwChunkSize = copy.dwChunkSize; wFormatTag = copy.wFormatTag; dwSamplesPerSec = copy.dwSamplesPerSec; wChannels = copy.wChannels; dwAvgBytesPerSec = copy.dwAvgBytesPerSec; wBlockAlign = copy.wBlockAlign; wBitsPerSample = copy.wBitsPerSample; fillBytes = copy.fillBytes; }
public void Cat(Wav inputFile) { if (header == null) { header = new wavHeader(inputFile.header); format = new wavFormat(inputFile.format); data = new wavData(inputFile.data); } else { data.Cat(inputFile); } }
public void Write(BinaryWriter writer, wavFormat format, wavData data) { calcLen(format, data); writer.Write(sGroupID.ToCharArray()); writer.Write(dwFileLength); writer.Write(sRiffType.ToCharArray()); // Write the format chunk format.Write(writer); // Write the data chunk data.Write(writer); }
public void Load(string filePath) { clear(); FileName = filePath; Name = Path.GetFileName(FileName); using (FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read)) { using (BinaryReader reader = new BinaryReader(fileStream)) { // Read the header header = wavHeader.Read(reader); // Read the format chunk format = wavFormat.Read(reader); // Read the data chunk data = wavData.Read(reader); OrigDuration = Duration; reader.Close(); } fileStream.Close(); } }
private void calcLen(wavFormat format, wavData data) { dwFileLength = (uint)sRiffType.Length + format.getLength() + data.getLength(); }