mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00

This CL adds `SonicTest` and `RandomParameterizedSonicTest` as initial basic unit testing for `Sonic.java`. The tested scenarios do not necessarily verify a correct implementation of Sonic, but rather hope to catch any behaviour change from the current implementation. The change includes a small fix for a lossy simplification and also checks whether the output sample count matches the expected drift from the truncation accumulation error present in Sonic's resampler. This is important as pre-work for fixing issues with unexpected durations within `SonicAudioProcessor` and `SpeedChangingAudioProcessor` that cause AV sync issues for speed changing effects. This is a partial roll forward ofe88d6fe459
, which was rolled back in873d485056
. PiperOrigin-RevId: 677756854