AudioFileMp3 - handle clipping better
Fixed bug - when a sample clipped it was causing an overflow, making random noise where clipping happened. Now it clips properly.
This commit is contained in:
@@ -276,7 +276,7 @@ bool AudioFileMp3::startEncoding( void )
|
||||
|
||||
|
||||
short int AudioFileMp3::rescale(float sample) {
|
||||
return (sample / 1) * std::numeric_limits<short int>::max();
|
||||
return (qMin<float>(sample, 1) / 1) * std::numeric_limits<short int>::max();
|
||||
}
|
||||
|
||||
// encode data and write to file
|
||||
|
||||
Reference in New Issue
Block a user