
Sonic would accumulate truncation errors on float to int conversions that caused the final output sample count to drift noticeably, by hundreds of samples on streams of a few minutes of length. The fix now keeps track of the truncation error and compensates for it. Other small fixes include eliminating lossy operations (e.g. int division) and using doubles instead of floats for resampling where helpful. This CL also introduces `SonicParameterizedTest`, which helps test resampling on an arbitrary number of randomly generated parameters, with random sample data. `SonicParameterizedTest` uses `BigDecimal`s for calculating sample count values, as to avoid precision issues with large sample counts. PiperOrigin-RevId: 673852768
Transformer module
Provides functionality for transforming media files.
Getting the module
The easiest way to get the module is to add it as a gradle dependency:
implementation 'androidx.media3:media3-transformer:1.X.X'
where 1.X.X
is the version, which must match the version of the other media
modules being used.
Alternatively, you can clone this GitHub project and depend on the module locally. Instructions for doing this can be found in the top level README.