From ea3f837c90afaeb3334514f2f33fe677998adab9 Mon Sep 17 00:00:00 2001 From: Kamal Mostafa Date: Sat, 23 Apr 2016 10:30:32 -0700 Subject: [PATCH] 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 --- src/simpleaudio-sndfile.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/simpleaudio-sndfile.c b/src/simpleaudio-sndfile.c index d7c4f03..edb9556 100644 --- a/src/simpleaudio-sndfile.c +++ b/src/simpleaudio-sndfile.c @@ -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;