Skip to content

Python API for controlling Snapcast, a multi-room synchronous audio solution.

License

Notifications You must be signed in to change notification settings

bjobo/python-snapcast

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status PyPI version

python-snapcast

Control Snapcast in Python 3. Reads client configurations, updates clients, and receives updates from other controllers.

Supports Snapcast 0.15.0.

Install

pip install snapcast

Usage

Control

import asyncio
import snapcast.control

loop = asyncio.get_event_loop()
server = loop.run_until_complete(snapcast.control.create_server(loop, 'localhost'))

# print all client names
for client in server.clients:
  print(client.friendly_name)

# set volume for client #0 to 50%
client = server.clients[0]
loop.run_until_complete(server.client_volume(client.identifier, {'percent': 50, 'muted': False}))

Client

Note: This is experimental. Synchronization is not yet supported. Requires GStreamer 1.0.

import snapcast.client

client = snapcast.client.Client('localhost', snapcast.client.SERVER_PORT)
client.register()
client.request_start() # this blocks

About

Python API for controlling Snapcast, a multi-room synchronous audio solution.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.8%
  • Makefile 0.2%