Code: Select all
import dbus
# Clementine lives on the Session bus
session_bus = dbus.SessionBus()
# Get Clementine's player object, and then get an interface from that object,
# otherwise we'd have to type out the full interface name on every method call.
player = session_bus.get_object('org.mpris.clementine', '/Player')
iface = dbus.Interface(player, dbus_interface='org.freedesktop.MediaPlayer')
# Call a method on the interface
metadata = iface.GetMetadata()
print metadata["title"]
print metadata["artist"]Code: Select all
iface.Next()I got it to run a script to play a sound when clicking a html button but it redirects the page to the route defined for the script and can't click another button to play another sound. I have to go back to index but then the button doesn't work. I want to have about 20 html or php buttons each linked to a script for a different sound. For instance I click button 'A' and it plays sound 'A' then I want to press button 'B' to play sound 'B' etc.topguy wrote: ↑Sun Aug 13, 2017 1:42 pmDefinitly doable, and there would be many different ways of doing it. Maybe too many, your experience would be useful to know to reduce the number of options.
An example:
- A pure Python based solution using "Flask" ( https://www.raspberrypi.org/learning/py ... ith-flask/ ) to create web-server/page and then use PyGame to play sounds (http://www.nerdparadise.com/programming/pygame/part3).