KotlinAudio
KotlinAudio copied to clipboard
feat: crossfade
this PR is WIP; code quality is quite bad but I need advice on how to properly implement this. Functionality-wise it seems to work.
while exoplayer does not natively support crossfade/gapless playback, crossfade can be achieved by rotating 2 exoplayers on track switching. I initialized 2 exoplayers in BaseAudioPlayer and made fun switchExoplayer that rotates exoplayer to NotificationManager, and added volume fade. The 2 exoplayers have synchronous queues and queue positions, so seekToNextMediaItem/Previous will work as intended.
MainAcitivity has a refresh button that plays the next track with crossfade for the demo.