[GH-ISSUE #1048] Control audio playback through an API #495

Closed
opened 2026-02-27 19:30:58 +03:00 by kerem · 6 comments
Owner

Originally created by @vidicunt on GitHub (Aug 19, 2022).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1048

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

Originally created by @vidicunt on GitHub (Aug 19, 2022). Original GitHub issue: https://github.com/librespot-org/librespot/issues/1048 Is it possible to control audio aspects through code without input from a Spotify client? (e.g. skip track, pause, etc)
kerem 2026-02-27 19:30:58 +03:00
Author
Owner

@michaelherger commented on GitHub (Aug 19, 2022):

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

<!-- gh-comment-id:1220836512 --> @michaelherger commented on GitHub (Aug 19, 2022): Use the web API: https://developer.spotify.com/console/player/
Author
Owner

@vidicunt commented on GitHub (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?

<!-- gh-comment-id:1221082254 --> @vidicunt commented on GitHub (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?
Author
Owner

@fi5ch commented on GitHub (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/

<!-- gh-comment-id:1221091371 --> @fi5ch commented on GitHub (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/
Author
Owner

@vidicunt commented on GitHub (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/

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...

<!-- gh-comment-id:1221098655 --> @vidicunt commented on GitHub (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/ 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...
Author
Owner

@fi5ch commented on GitHub (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.

<!-- gh-comment-id:1221108771 --> @fi5ch commented on GitHub (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.
Author
Owner

@eladyn commented on GitHub (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)
<!-- gh-comment-id:1221132995 --> @eladyn commented on GitHub (Aug 19, 2022): There is [`spotifyd`](https://github.com/Spotifyd/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](https://github.com/Spotifyd/spotifyd/pull/1025), [#954](https://github.com/Spotifyd/spotifyd/pull/954))
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#495
No description provided.