mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-11-21 20:00:49 +01:00
With AudioTrack playback parameters media3 sizes the PCM buffer for 8x speed, about 3 s at normal speed. Once a song's end is in that buffer the track is told to play out, so a song queued later (for example after a seek near the end) made the handoff open a new AudioTrack with a short gap. Size the buffer for 2x instead, a quarter of the size and still at least the normal buffer's time up to 2x, above the app's 1.2x maximum. Volume, speed and the session equalizer act after the buffer. Add an instrumentation test that measures queued handoffs with an analytics listener: audio tracks opened, underruns and total play time.