Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 631 Bytes

README.md

File metadata and controls

36 lines (27 loc) · 631 Bytes

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()