File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -954,7 +954,7 @@ bool AudioFile<T>::saveToWaveFile (std::string filePath)
954
954
}
955
955
else if (bitDepth == 24 )
956
956
{
957
- int32_t sampleAsIntAgain = (int32_t ) (samples[channel][i] * (T)8388608 .);
957
+ int32_t sampleAsIntAgain = (int32_t ) (samples[channel][i] * (T)8388607 .);
958
958
959
959
uint8_t bytes[3 ];
960
960
bytes[2 ] = (uint8_t ) (sampleAsIntAgain >> 16 ) & 0xFF ;
@@ -1064,7 +1064,7 @@ bool AudioFile<T>::saveToAiffFile (std::string filePath)
1064
1064
}
1065
1065
else if (bitDepth == 24 )
1066
1066
{
1067
- int32_t sampleAsIntAgain = (int32_t ) (samples[channel][i] * (T)8388608 .);
1067
+ int32_t sampleAsIntAgain = (int32_t ) (samples[channel][i] * (T)8388607 .);
1068
1068
1069
1069
uint8_t bytes[3 ];
1070
1070
bytes[0 ] = (uint8_t ) (sampleAsIntAgain >> 16 ) & 0xFF ;
@@ -1322,7 +1322,7 @@ int32_t AudioFile<T>::sampleToTwentyFourBitInt (T sample)
1322
1322
if (std::is_floating_point<T>::value)
1323
1323
{
1324
1324
sample = clamp (sample, -1 ., 1 .);
1325
- return static_cast <int32_t > (sample * 8388608 .);
1325
+ return static_cast <int32_t > (sample * 8388607 .);
1326
1326
}
1327
1327
else
1328
1328
{
You can’t perform that action at this time.
0 commit comments