mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 17:30:17 +01:00
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:
@@ -611,7 +611,7 @@ ProgressResult ExportPCM::Export(AudacityProject *project,
|
|||||||
|
|
||||||
{
|
{
|
||||||
std::vector<char> dither;
|
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));
|
dither.reserve(maxBlockLen * info.channels * SAMPLE_SIZE(int24Sample));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -638,7 +638,7 @@ ProgressResult ExportPCM::Export(AudacityProject *project,
|
|||||||
samplePtr mixed = mixer->GetBuffer();
|
samplePtr mixed = mixer->GetBuffer();
|
||||||
|
|
||||||
// Bug 1572: Not ideal, but it does add the desired dither
|
// 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) {
|
for (int c = 0; c < info.channels; ++c) {
|
||||||
CopySamples(
|
CopySamples(
|
||||||
mixed + (c * SAMPLE_SIZE(format)), format,
|
mixed + (c * SAMPLE_SIZE(format)), format,
|
||||||
|
|||||||
Reference in New Issue
Block a user