The data size in the wav file contains parts (28 Bytes) of the size of the wav header information.
Reason:
The bytesWritten component of the Writer struct sums up the actual wav data,
but in Routine NewWriter the size of the header information is added all well.
In Routine Close this size is used as size of the data segment.
Solution:
Don't add the size of the header information in bytesWritten.
The data size in the wav file contains parts (28 Bytes) of the size of the wav header information.
Reason:
The bytesWritten component of the Writer struct sums up the actual wav data,
but in Routine NewWriter the size of the header information is added all well.
In Routine Close this size is used as size of the data segment.
Solution:
Don't add the size of the header information in bytesWritten.