From 1a82869175674f6be990b726c669b027e6858d51 Mon Sep 17 00:00:00 2001 From: Shinya Kitaoka Date: Fri, 8 Apr 2022 20:57:39 +0900 Subject: [PATCH] Update encode.go --- wav/encode.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wav/encode.go b/wav/encode.go index 0e35931..7f2792c 100644 --- a/wav/encode.go +++ b/wav/encode.go @@ -81,7 +81,7 @@ func Encode(w io.WriteSeeker, s beep.Streamer, format beep.Format) (err error) { } // finalize header - h.FileSize = int32(44 + written) // 44 is the size of the header + h.FileSize = int32(44 - 8 + written) // 44-8 is the size of the header without RIFF signature and the length of the RIFF chunk h.DataSize = int32(written) if _, err := w.Seek(0, io.SeekStart); err != nil { return err