Bug 2676 - Export: Incorrect handling over 0 dB
This bug was caused by dither being applied to all float output, and dither clips to +1/-1 to avoid high values, especially NaNs, polluting audio downstream. Dither was applied because of an incorrect fix for Bug 1572. The 1572 fix assumed SF_FORMAT_PCM_24 was a (1 << N) value, rather than from an enumeration. Hence a check involving it requires a mask, which it now has.
This commit is contained in:
parent
f5317775a0
commit
cca372fb92
|
@ -611,7 +611,7 @@ ProgressResult ExportPCM::Export(AudacityProject *project,
|
|||
|
||||
{
|
||||
std::vector<char> dither;
|
||||
if (info.format & SF_FORMAT_PCM_24) {
|
||||
if ((info.format & SF_FORMAT_SUBMASK) == SF_FORMAT_PCM_24) {
|
||||
dither.reserve(maxBlockLen * info.channels * SAMPLE_SIZE(int24Sample));
|
||||
}
|
||||
|
||||
|
@ -638,7 +638,7 @@ ProgressResult ExportPCM::Export(AudacityProject *project,
|
|||
samplePtr mixed = mixer->GetBuffer();
|
||||
|
||||
// Bug 1572: Not ideal, but it does add the desired dither
|
||||
if (info.format & SF_FORMAT_PCM_24) {
|
||||
if ((info.format & SF_FORMAT_SUBMASK) == SF_FORMAT_PCM_24) {
|
||||
for (int c = 0; c < info.channels; ++c) {
|
||||
CopySamples(
|
||||
mixed + (c * SAMPLE_SIZE(format)), format,
|
||||
|
|
Loading…
Reference in New Issue