public void Save(string path) { using (var writer = new BinaryWriter(File.Open(path, FileMode.Create), Encoding.ASCII)) { AddTerminals(); writer.Write("RIFF".ToCharArray()); writer.Write(size); writer.Write("sfbk".ToCharArray()); InfoChunk.Write(writer); SoundChunk.Write(writer); HydraChunk.Write(writer); } }
public void Save(string path) { Writer = new BinaryWriter(File.Open(path, FileMode.Create)); AddTerminals(); size = 4; size += infoChunk.Size + 8; size += soundChunk.CalculateSize() + 8; size += hydraChunk.CalculateSize() + 8; Writer.Write("RIFF".ToCharArray()); Writer.Write(size); Writer.Write("sfbk".ToCharArray()); infoChunk.Write(); soundChunk.Write(); hydraChunk.Write(); Writer.Close(); }