Skip to content

Commit 9606a66

Browse files
committed
Fixed a bug with FLACWriter in non 16-bit depths
1 parent f51a128 commit 9606a66

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

choc/audio/choc_AudioFileFormat_FLAC.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17761,7 +17761,7 @@ struct FLACAudioFileFormat<supportWriting>::Implementation
1776117761

1776217762
auto bits = encoder->protected_->bits_per_sample;
1776317763
CHOC_ASSERT (bits != 0);
17764-
floatToIntScaleFactor = static_cast<double> ((1u << (31u - bits)) - 1);
17764+
floatToIntScaleFactor = static_cast<double> ((1u << (bits - 1u)) - 1);
1776517765
}
1776617766

1776717767
~FLACWriter() override

0 commit comments

Comments
 (0)