-
Notifications
You must be signed in to change notification settings - Fork 133
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
[Feature Request] Cross Fade #237
Comments
Or (if it's possible) pre-cache the opening few seconds of the next track in the queue, and implement a capless playback option for live/mixed albums. |
Isn't the playback gapless already? I've listened to some live albums and always got smooth transition between tracks without any pauses (unless the artists put them in, that is). |
It would be great if there was a smooth fade between tracks I suppose it would have to cache tracks when you start to play the album so it can cache it and can start by playing the next track - is this a feature that will be added … |
Playback is seamless for downloaded songs. There is a delay only for streamed songs. If you have albums that aren't supposed to have a gap between the tracks I would try downloading those albums. |
I should have explained this better I mean like a cross fade option so the songs fade together smoothly |
This isn't implemented in just_audio due to platform support (ryanheise/just_audio#815), it may be possible once I get around to the new player backend (#177) |
I too am interested in this for streaming, but gapless does seem to work in my brief testing with downloaded content. |
They use this feature on a few open source apps ie play sub and avsub and it works well they are open source and may help |
@BloodyIron Do you know if gapless audio worked with downloaded content when not in offline mode? I'm guessing Finamp is smart enough to always use the downloaded/cached version and so the seamless audio would apply, but unsure. |
Yeah Finamp always defaults to downloaded content when it's available |
Would it be possible to implement cross fade by creating two instances of the music player (It seems like it may be possible)? I'd be happy to look into it if it's not too impractical. |
@BobcatNoah yes, that was the approach suggested by Ryan Heise over in the just_audio issue. However, I'm not sure how well thing would work, it could severely complicate things regarding pre-caching and queue handling. We would have to split the |
Does Finamp cache the entire queue, not just the next song? Well, that's unfortunate. It'd be great to have this feature. |
Not the entire queue, just a certain duration in seconds. You can configure it in the "Audio Service" settings. I mean, you can try to implement it, maybe it works better than expected. It's just that just_audio and audio_service tend to be rather inflexible, and in my opinion reliable playback is more important than nice transitions. If you can make it work though, why not? :) |
I have an idea. It's crazy, but it might work and "should" be easy to implement. For this example I’ll just use a crossfade of 4 seconds. So, 4 seconds before the first song ends, you start playing the first 4 seconds of the second song. Once those 4 seconds are over, meaning the first song is over, you skip 4 seconds into the second song. If this can be done smoothly and the next song isn’t buffering, it should sound seamless. I started implementing this as an experiment, but I’m running into an issue. For some reason the crossfade audio doesn’t start playing until the first song ends, even if I play() it before the first song ends. Before you ask, I am using an additional AudioPlayer just for the crossfade. |
hmm, are you on iOS or Android? |
iOS simulator. Also, if you want to see my code, I could push it to my fork. |
I took a break from coding and I think it was just an issue with my code. I sort of fixed it, now it's just playing at the end and the beginning of the song. |
Nice! How does it sound? |
It's not quite working yet because I'm running into an issue with seeking. I want the player to seek x amount of seconds into the next song after the end of each song. I initially tried the code below in order to seek every time the current song changes, but I get this error. Unhandled Exception: Bad state: Cannot fire new event. Controller is already firing an event
Do you have any ideas of how to achieve this seeking effect (or fix the error, but there is probably a better way to do the seeking)? |
You might want to only do the seeking if the index actually changed, because the event is fired more often. And to get started, maybe a short delay fixes the error? Just to see if it works at all... |
This is the best I could get it to sound. I'll probably send a better example video later because I was skipping around the song in this video. 2023-10-30.17-59-44.mp4 |
Awesome! Just open a PR when you're ready and I'll check it out! |
Is cross fade going to be optional? I prefer the current functionality but I support giving additional functionality to those who want crossfade. |
Yes, it would be optional. However, I am no longer working on the feature. |
What I like about PlexAmp is that once a song end by itself, there is a crossfade (Which they call "Sweet Fade) so the transition between the current song and the next song is smooth, it's very effective on Live albums because it eliminates the micro moment where there is silence that is there when the next song loads
Would be cool to have the same feature
The text was updated successfully, but these errors were encountered: