Fix --tx float consistency: disable .wav "PEAK chunk" header

Fixes: tests/17-verify-tx-consistent-float.test

This might also relate to:
https://github.com/kamalmostafa/minimodem/issues/24
This commit is contained in:
Kamal Mostafa 2016-04-23 10:30:32 -07:00
parent 78cff1778b
commit ea3f837c90
1 changed files with 9 additions and 0 deletions

View File

@ -200,6 +200,15 @@ sa_sndfile_open_stream(
return 0;
}
// Disable the insertion of this questionable "PEAK chunk" header thing.
// Relates only to writing SF_FORMAT_FLOAT .wav and .aiff files
// (minimodem --tx --float-samples). When left enabled, this adds some
// wonky bytes to the header which change from run to run (different every
// wall-clock second. WTF?
// http://www.mega-nerd.com/libsndfile/command.html#SFC_SET_ADD_PEAK_CHUNK
/* Turn off the PEAK chunk. */
sf_command(s, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_FALSE);
/* good or bad to override these? */
sa->rate = sfinfo.samplerate;
sa->channels = sfinfo.channels;