Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Control audio playback through an API #1048

Closed
vidicunt opened this issue Aug 19, 2022 · 6 comments
Closed

Control audio playback through an API #1048

vidicunt opened this issue Aug 19, 2022 · 6 comments

Comments

@vidicunt
Copy link

vidicunt commented Aug 19, 2022

Is it possible to control audio aspects through code without input from a Spotify client? (e.g. skip track, pause, etc)

@michaelherger
Copy link
Contributor

Use the web API: https://developer.spotify.com/console/player/

@vidicunt vidicunt reopened this Aug 19, 2022
@vidicunt
Copy link
Author

vidicunt commented Aug 19, 2022

Does not really satisfy my use case since many clients would connect to that same speaker and I'd try to avoid getting OAuth API keys from each of them. Isn't there a way to do it locally, via librespot?

@fi5ch
Copy link

fi5ch commented Aug 19, 2022

I'm also looking for a way to do this. I want to run Librespot on a Raspberry Pi connected to a small display that shows the current player status and in addition I want to control the player with connected buttons.
If there is no such API on Librespot, maybe this would be an alternative: https://pypi.org/project/spotify-local-control/

@vidicunt
Copy link
Author

I'm also looking for a way to do this. I want to run Librespot on a Raspberry Pi connected to a small display that shows the current player status and in addition I want to control the player with connected buttons.
If there is no such API on Librespot, maybe this would be an alternative: https://pypi.org/project/spotify-local-control/

Thank you for the reply! This library only works if the Spotify app client is active on the PC right? Still wouldn't satisfy me if I had random phone users logging via zeroconf to the server...

@fi5ch
Copy link

fi5ch commented Aug 19, 2022

I haven't tried it yet, that's just what I found when I was looking for something like this I don't even know if this python project is still active. But I think there will be something along the lines that will cover this use case. Anyhow, an API at Librespot would definitely be useful and nice. Unfortunately I don't have any experience with Rust to implement it myself.

@eladyn
Copy link
Contributor

eladyn commented Aug 19, 2022

There is spotifyd, which builds upon librespot. It offers, among other things, a DBus MPRIS interface, which can be used to query and modify the current playback state.

Do note however that:

  • The project is not that active at the moment and the version of e.g. librespot that is used is still 0.2.0.
  • Depending on your exact use case, you may need some additions that haven't made it into a release yet. (#1025, #954)

@librespot-org librespot-org locked and limited conversation to collaborators Aug 20, 2022
@roderickvd roderickvd converted this issue into discussion #1050 Aug 20, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

4 participants