Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Crossfade function #43

Open
pes0 opened this issue Mar 31, 2015 · 3 comments
Open

Crossfade function #43

pes0 opened this issue Mar 31, 2015 · 3 comments

Comments

@pes0
Copy link

pes0 commented Mar 31, 2015

I would really love to have spotify's crossfade function in spop.
Is this technically possible?

How could I contribute?

Thanks

@Schnouki
Copy link
Owner

Thanks for the suggestion; however I doubt it can be done. If it was supported in libspotify it would probably be quite easy. But to do that in spop, we would need to do some nasty things, like cache audio samples and delay their playback, then do some signal processing to do the actual crossfading, and the finally play them. That's quite complicated...

Besides, libspotify won't deliver audio samples faster than their normal playback speed. This means that you won't be able to get the end of a track and the beginning of the next one early, which would be needed for the crossfade effect to work.

So... I really don't think it's possible.

Sorry! 😞

@pes0
Copy link
Author

pes0 commented Apr 14, 2015

Thanks for your answer, but I already did some research before asking here,
and as you can see here:
http://stackoverflow.com/questions/15857209/how-do-i-audio-crossfade-using-cocoalibspotify
it should be possible to increase the cache size and to use 2 queues which could be crossfaded.
This is for cocoalibspotify though.
Could you be so kind and read the link and comment back once again?
Thank you very much for your attention.

@Schnouki
Copy link
Owner

This could be possible, but IMHO there are several difficult points:

  • "tricking" libspotify into delivering audio samples faster to fill a second queue while the first one is still playing: normally it only delivers audio samples fast enough at first to fill a cache, and then at the rate needed to play tracks at a normal speed
  • handling current playing state in spop during the crossfade (when we're getting audio samples from a track but playing another, or both at the same time)
  • and finally doing the audio processing to crossfade both audio streams

Honestly, as I don't use this feature, I probably won't bother to implement it. But if someone provides a working implementation, I'll be glad to merge it and maintain it in the future.

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

No branches or pull requests

2 participants