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 control #275

Open
tatoosh opened this issue Jan 27, 2018 · 5 comments
Open

Volume control #275

tatoosh opened this issue Jan 27, 2018 · 5 comments

Comments

@tatoosh
Copy link

tatoosh commented Jan 27, 2018

Is there a solution to control music Volumen by command line ?

@thekr1s
Copy link

thekr1s commented Jan 28, 2018

I don't think librespot is the place for this. You might have a look at spotipy (https://github.com/plamere/spotipy) to create a python scrip to control the volume..

@ComlOnline
Copy link

Just to add for reference spotcontrol.

@tatoosh
Copy link
Author

tatoosh commented Feb 9, 2018

@thekr1s thx for the link, but i can't find volume control for spotipy
@ComlOnline: great, but it's not python just 'go' - any other suggestions?

@tatoosh
Copy link
Author

tatoosh commented Feb 9, 2018

@thekr1s got it working :)

python volume.py 80 -> sets volume to 80%

here my working python code_

import pprint
import sys

import spotipy
import spotipy.util as util

scope = 'user-modify-playback-state'
username = 'YOURUSER'
token = util.prompt_for_user_token(username,scope,client_id='mine!',client_secret='mine!',redirect_uri='http://localhost:8888/callback/')
volume  = int(sys.argv[1])

if token:
    sp = spotipy.Spotify(auth=token)
    sp.trace = False
    results = sp.volume(volume)
    print results
else:
    print "Can't get token for", username

@thekr1s
Copy link

thekr1s commented Feb 18, 2018

@tatoosh, Great that you got it working.

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

3 participants