From ff7c013f160b4b140fbf2b16e20a2e00c8c39f95 Mon Sep 17 00:00:00 2001 From: mchinen Date: Tue, 15 Jun 2010 17:51:23 +0000 Subject: [PATCH] fix clipping on export 24 bit signed pcm wav (bug 166) --- src/export/ExportPCM.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/export/ExportPCM.cpp b/src/export/ExportPCM.cpp index a35f104b1..0a877c7b8 100644 --- a/src/export/ExportPCM.cpp +++ b/src/export/ExportPCM.cpp @@ -485,6 +485,8 @@ int ExportPCM::Export(AudacityProject *project, // libsndfile can't (under Windows). ODManager::LockLibSndFileMutex(); sf = sf_open_fd(f.fd(), SFM_WRITE, &info, FALSE); + //add clipping for integer formats. We allow floats to clip. + sf_command(sf, SFC_SET_CLIPPING, NULL,sf_subtype_is_integer(sf_format)?SF_TRUE:SF_FALSE) ; ODManager::UnlockLibSndFileMutex(); }