librespot-org / librespot

Open Source Spotify client library
MIT License
4.46k stars 540 forks source link

support for setting volume directly in addition to volume up/down #1252

Closed morunner closed 4 months ago

morunner commented 4 months ago

my issue I am using librespot for programming a spotify connect with an additional speaker. I am using a potentiometer for volume control. As far as I can see, there is no possibility to directly set the volume on the running client.

desired solution Allow calling the mixer set_volume function directly on the running task instead of only increasing/decreasing the volume by steps.

possible alternative I am using a Raspberry Pi Zero W as platform. There I could also set the volume on alsa directly. But then, the hardware volume control interferes with the volume control of the spotify client. Additionally, my implemented volume control is not in sync with the volume of the librespot spotify client.

morunner commented 4 months ago

I have just seen, that this is already being covered in dev (https://github.com/librespot-org/librespot/blob/dev/connect/src/spirc.rs#L433). Thus, I am closing again.