Skip to content
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

Volume is not set to exact given value #7

Open
jbriales opened this issue May 27, 2020 · 2 comments
Open

Volume is not set to exact given value #7

jbriales opened this issue May 27, 2020 · 2 comments

Comments

@jbriales
Copy link

When assigning volume to say '0.14' if I read the value afterwards it's 0.11.
I've seen several weird behaviors in this sense.
Do you have an idea about the explanation or limitations of the API,
like e.g. what's the precision when assigning values?

@freundTech
Copy link
Owner

freundTech commented May 27, 2020

Spotify stores volume as an int (1-100), while mpris2 uses a float (0.0-1.0). This can lead to a loss of accuracy, however it shouldn't for values with only 2 digits after the decimal point.

I just tested setting 0.14 and got 0.14 back when asking for the volume.
Could you give some more details on your setup?
Mainly: SpotPRIS2 version, spotify client (native, web, ...), mpris client.

The code converting between those representations is at https://github.com/freundTech/SpotPRIS2/blob/master/spotpris2/util.py#L35

@jbriales
Copy link
Author

I tried setting e.g. 0.17 and then get value is 0.16.
Then I set again to 0.17, and the get value became 0.17 this time.
It's a bit confusing.

Can you point how to get the relevant versioning and client info?
I'm using the native client for Spotify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants