From d3359f5a704d889ad97217a68207fb4334e4ef10 Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Tue, 6 Jun 2017 23:06:15 +0200 Subject: [PATCH] Fix #3616 by preventing fold overs for clipped data Use libsndfile functionality to prevent fold overs when exporting clipped data. The fold overs occurred when exporting with a bit depth of 24 bit. --- src/core/audio/AudioFileWave.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/audio/AudioFileWave.cpp b/src/core/audio/AudioFileWave.cpp index fb6e2901f..45e46b838 100644 --- a/src/core/audio/AudioFileWave.cpp +++ b/src/core/audio/AudioFileWave.cpp @@ -79,7 +79,12 @@ bool AudioFileWave::startEncoding() outputFile().toUtf8().constData(), #endif SFM_WRITE, &m_si ); + + // Prevent fold overs when encountering clipped data + sf_command(m_sf, SFC_SET_CLIPPING, NULL, SF_TRUE); + sf_set_string ( m_sf, SF_STR_SOFTWARE, "LMMS" ); + return true; }