Cog icon indicating copy to clipboard operation
Cog copied to clipboard

any plans for crossfade support?

Open jeremytammik opened this issue 6 years ago • 3 comments

thank you for this nice little minimalist player. it is exactly what i have been searching for a long time, except one minimal future lacking: crossfade, blending from one track to the next. would that be hard to add? any plans in the works for such a feature?

jeremytammik avatar Jun 17 '18 09:06 jeremytammik

Crossfading is made ever more difficult by the current implementation, which doesn't resample any audio formats, and supports multiple arbitrary channel configurations. I would need to support resampling the previous track to match the sample rate of the upcoming track, and I would need to merge their channel configurations together.

I'll think about it.

kode54 avatar Jul 03 '22 05:07 kode54

Come to think of it, I could do it differently. Instead, I could have two AVSampleBufferAudioRenderer instances, with different PTS positions, overlapping them, and adding the new one when the overlap occurs, and then removing the old one once it plays out. Hmm...

kode54 avatar Jul 03 '22 05:07 kode54

Yes, I could make it possible to crossfade between ends of tracks and starts of the next, but it would be fixed interval, unless I can find handy code to demonstrate a proper beat matching to time the crossfades. It would also have to be limited to at most the duration of the playback/converter buffering, which is currently up to 10 seconds.

kode54 avatar Oct 09 '23 01:10 kode54