spotify / web-playback-sdk

This issue tracker is no longer used. Join us in the Spotify for Developers forum for support with the Spotify Web Playback SDK ➡️ https://community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer
107 stars 7 forks source link

Fade and stop song on button press #57

Open sfxhewitt opened 5 years ago

sfxhewitt commented 5 years ago

Is it possible for me to mod Spotify to fade out a song and stop after pressing a designated key? I'm a dj/karaoke man and would be really handy to have this feature because I hate stopping music dead and would rather have it fade out, any input is appreciated.

itsjustbrian commented 5 years ago

Yes that would be possible with this SDK. You could implement your "fade out" by having the designated key start incrementally lowering the volume over a certain period of time with the setVolume method, and after the volume reaches 0, call pause. However, I'd have to recommend against using this SDK if that's your only purpose. I can guarantee it'll be more trouble than it's worth. There's probably more proven solutions to this problem in that space. Maybe some program that adjusts the application volume of desktop Spotify.

sfxhewitt commented 5 years ago

Any idea of said program?

On Fri, 4 Jan 2019, 9:12 pm Brian Ferch <notifications@github.com wrote:

Yes that would be possible with this SDK. You could implement your "fade out" by having the designated key start incrementally lowering the volume over a certain period of time with the setVolume method, and after the volume reaches 0, call pause. However, I'd have to recommend against using this SDK if that's your only purpose. I can guarantee it'll be more trouble than it's worth. There's probably more proven solutions to this problem in that space. Maybe some program that adjusts the application volume of desktop Spotify.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/spotify/web-playback-sdk/issues/57#issuecomment-451569767, or mute the thread https://github.com/notifications/unsubscribe-auth/AZlJFCUXpdbZ_lZ8UlntM85zKlIyeUN_ks5u_8OkgaJpZM4ZaszV .

itsjustbrian commented 5 years ago

Couldn't find anything that specifically does that after a quick search. The tools exist, but implementation will differ depending on your OS. On Mac OS it looks like you can use applescript to adjust volume and pause/play Spotify directly. On any OS you could also make a script that just lowers your system volume to 0 and then runs the media key pause macro (this is what media keys on your keyboard do if you have them).

itsjustbrian commented 5 years ago

Hi @sfxhewitt could you please close this issue if you don't have any further questions?