librespot-android icon indicating copy to clipboard operation
librespot-android copied to clipboard

Implement Volume Handling

Open mitschwimmer opened this issue 4 years ago • 2 comments

Let me begin with a question. The sink API defines a method ".setVolume()". Should this method be implented in such a way that it:

  1. actually controlls the media volume of the device
  2. controls the gain level of the current track. It would default to "1.0" which means flat, unchanged gain
  3. does nothing on Android as most users of this lib would use an "android-idiomatic" way of manipulating volume

I think the third option makes sense. @devgianlu what do you think?

mitschwimmer avatar Apr 25 '21 14:04 mitschwimmer

On the "desktop" version it controls the line volume directly. Which in Android would be the equivalent of modifying the device volume, but I do not like this idea. I think the best solution is to have double volume control (Linux has master and line volumes):

  • if the volume change event comes from the device it should be a no-op for the library
  • if the volume change event comes from the Spotify API, change the internal volume of the sink.

We should probably have a look at what the original client for Android does.

devgianlu avatar Apr 25 '21 15:04 devgianlu

We should probably have a look at what the original client for Android does.

Adding to this old issue, the original Android client does not modify the volume in any way. If you use Spotify Connect from another device, you can't modify the volume of the Android client. This is something I've always thought would be nice to have, and for me, the best way would be modifying the device's volume directly (but only if Spotify is playing).

iscle avatar Feb 07 '22 17:02 iscle