Skip to content

Instantly share code, notes, and snippets.

@G10DRAS G10DRAS/volumeup.py
Created Aug 11, 2016

Embed
What would you like to do?
Python Script to Volume control MPD
import mpd
client = mpd.MPDClient()
client.timeout = None
client.idletimeout = None
client.connect('localhost', 6600)
client.listplaylists()
client.load("RADIO")
client.playlist()
client.status()['volume']
client.status()['state']
level = int(client.status()['volume']) + 10
level = max(min(level, 100), 0)
client.setvol(level)
client.status()['volume']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.