Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: crossfade #92

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Conversation

lovegaoshi
Copy link

@lovegaoshi lovegaoshi commented Sep 10, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant