Cog
Cog copied to clipboard
any plans for crossfade support?
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?
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.
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...
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.