ChunkSize should be size entire file in bytes minus 8 bytes
Ref : https://ccrma.stanford.edu/courses/422/projects/WaveFormat/
This commit is contained in:

committed by
Michael Ossmann

parent
bfc004b95e
commit
05416031c2
@ -984,7 +984,7 @@ int main(int argc, char** argv) {
|
|||||||
/* Get size of file */
|
/* Get size of file */
|
||||||
file_pos = ftell(fd);
|
file_pos = ftell(fd);
|
||||||
/* Update Wav Header */
|
/* Update Wav Header */
|
||||||
wave_file_hdr.hdr.size = file_pos+8;
|
wave_file_hdr.hdr.size = file_pos-8;
|
||||||
wave_file_hdr.fmt_chunk.dwSamplesPerSec = sample_rate_hz;
|
wave_file_hdr.fmt_chunk.dwSamplesPerSec = sample_rate_hz;
|
||||||
wave_file_hdr.fmt_chunk.dwAvgBytesPerSec = wave_file_hdr.fmt_chunk.dwSamplesPerSec*2;
|
wave_file_hdr.fmt_chunk.dwAvgBytesPerSec = wave_file_hdr.fmt_chunk.dwSamplesPerSec*2;
|
||||||
wave_file_hdr.data_chunk.chunkSize = file_pos - sizeof(t_wav_file_hdr);
|
wave_file_hdr.data_chunk.chunkSize = file_pos - sizeof(t_wav_file_hdr);
|
||||||
|
Reference in New Issue
Block a user