rstemmer / shouty

Minimal and pythonic wrapper to libshout2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shouty

Minimal and pythonic wrapper to libshout2.

Examples

import shouty

params = {
    'host': 'localhost',
    'port': 8000,
    'user': 'source',
    'password': 'hackme',
    'format': shouty.Format.MP3,
    'mount': '/shouty'
}

with shouty.connect(**params) as connection:
    connection.send_file('file.mp3')

To send a file manually:

with shouty.connect(**params) as connection:
    with open('file.mp3', 'rb') as f:
        while True:
            chunk = f.read(4096)
            if not chunk:
                break

            connection.send(chunk)
            connection.sync()

About

Minimal and pythonic wrapper to libshout2

License:MIT License


Languages

Language:Python 100.0%