AudioFileMp3 - fixed clipping issue
AudioFileMp3::rescale was missing a clip boundary on -1 and thus could have caused artifacts in exported MP3s. Fixed.
This commit is contained in:
@@ -149,7 +149,7 @@ bool AudioFileMp3::startEncoding( void )
|
||||
|
||||
|
||||
short int AudioFileMp3::rescale(float sample) {
|
||||
return (qMin<float>(sample, 1) / 1) * std::numeric_limits<short int>::max();
|
||||
return (qMax<float>(qMin<float>(sample, 1), -1) / 1) * std::numeric_limits<short int>::max();
|
||||
}
|
||||
|
||||
// encode data and write to file
|
||||
|
||||
Reference in New Issue
Block a user