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 @@ -1394,7 +1394,7 @@ T AudioSampleConverter<T>::thirtyTwoBitIntToSample (int32_t sample)
1394
1394
else if (std::numeric_limits<T>::is_integer)
1395
1395
{
1396
1396
if constexpr (std::is_signed_v<T>)
1397
- return static_cast <T> (clamp ( sample, - 2147483648 , 2147483647 ) );
1397
+ return static_cast <T> (sample);
1398
1398
else
1399
1399
return static_cast <T> (clamp (static_cast <T> (sample + 2147483648 ), 0 , 4294967295 ));
1400
1400
}
@@ -1407,8 +1407,8 @@ int32_t AudioSampleConverter<T>::sampleToThirtyTwoBitInt (T sample)
1407
1407
if constexpr (std::is_floating_point<T>::value)
1408
1408
{
1409
1409
// multiplying a float by a the max int32_t is problematic because
1410
- // of roundng errors which can cause wrong errors to come out, so
1411
- // we use a different
1410
+ // of roundng errors which can cause wrong values to come out, so
1411
+ // we use a different implementation here compared to other types
1412
1412
if constexpr (std::is_same_v<T, float >)
1413
1413
{
1414
1414
if (sample >= 1 .f )
You can’t perform that action at this time.
0 commit comments