Skip to main content

Easily host karaoke events

Project description

Easily host karaoke events

Matrix Mastodon Follow PyPI - Version Flathub Version PyPI - License Website Gitlab Pipeline Status

Syng is an all-in-one karaoke software, consisting of a backend server, a web frontend and a playback client. Karaoke performers can search a library using the web frontend, and add songs to the queue. The playback client retrieves songs from the backend server and plays them in order.

You can play songs from YouTube, an S3 storage or simply share local files.

The playback client uses mpv for playback and can therefore play a variety of file formats, such as mp3+cdg, webm, mp4, ...

Join our matrix room or follow us on mastodon for update notifications and support.

Screenshots

Main Window Main Window (Advanced) Web Interface

Client

Get in on Flathub

To host a karaoke event, you only need to use the playback client. You can use the publicly available instance at https://syng.rocks as your server.

Installation

Linux

The preferred way to install the client is via Flathub.

Alternatively Syng can be installed via the Python Package Index (PyPI). When installing the client it is mandatory to include the client flag:

pip install 'syng[client]'

This installs both the playback client (syng client) and a configuration GUI (syng gui).

Note: When installing via PyPI, you need to have mpv installed on the playback client, and the mpv binary must be in your PATH.

Windows

Windows support is experimental, but you can download the current version from Releases. No installation necessary, you can just run the exe.

Configuration

You can host karaoke events using the default configuration. But if you need more advanced configuration, you can either configure Syng using the GUI or via a text editor by editing ~/.config/syng/config.yaml. There are the following settings:

  • server: URL of the server to connect to.
  • room: The room code for your karaoke event. Can be chosen arbitrarily, but must be unique. Unused rooms will be deleted after some time. Note: Everyone, that has access to the room code can join the karaoke event.
  • secret: The admin password for your karaoke event. If you want to reconnect with a playback client to a room, these must match. Additionally, this unlocks admin capabilities to a web client, when given under "Advanced" in the web client.
  • waiting_room_policy: One of none, optional, forced. When a performer wants to be added to the playback queue, but has already a song queued, they can be added to the waiting room. none disables this behavior and performers can have multiple songs in the queue, optional gives the performer a notification, and they can decide for themselves, and forced puts them in the waiting room every time. Once the current song of a performer leaves the queue, the song from the waiting room will be added to the queue.
  • last_song: none or a time in ISO 8601. When a song is added to the queue, and its ending time exceeds this value, it is rejected.
  • preview_duration: Before every song, there is a short slide for the next performer. This sets how long it is shown in seconds.
  • key: If the server, you want to connect to is in private or restricted mode, this will authorize the client. Private server reject unauthorized playback clients, restricted servers limit the searching to be client only.
  • mpv_options: additional options forwarded to mpv.
  • show_advanced: show advanced options in the configuration GUI.

In addition to the general config, has its own configuration under the sources key of the configuration.

YouTube

Configuration is done under sourcesyoutube with the following settings:

  • enabled: true or false.
  • channels: list of YouTube channels. If this is a nonempty list, Syng will only search these channels, otherwise YouTube will be searched as a whole.
  • tmp_dir: YouTube videos will be downloaded before playback. This sets the directory, where YouTube videos are stored.
  • start_streaming: true or false. If true, videos will be streamed directly using mpv, if the video is not cached beforehand. Otherwise, Syng waits for the video to be downloaded.

S3

Configuration is done under sourcess3 with the following settings:

  • enabled: true or false.
  • extensions: List of extensions to be searched. For karaoke songs, that separate audio and video (e.g. CDG files), you can use mp3+cdg to signify, that the audio part is a mp3 file and the video is a cdg file. For karaoke songs, that do not separate this (e.g. mp4 files), you can simply use mp4.
  • endpoint: Endpoint of the s3.
  • access_key Access key for the s3.
  • secret_key: Secret key for the s3.
  • secure: If true uses ssl, otherwise not.
  • bucket: Bucket for the karaoke files.
  • index_file: Cache file, that contains the filenames of the karaoke files in the s3.
  • tmp_dir: Temporary download directory of the karaoke files.

Files

Configuration is done under sourcesfiles with the following settings:

  • enabled: true or false.
  • extensions: List of extensions to be searched. For karaoke songs, that separate audio and video (e.g. CDG files), you can use mp3+cdg to signify, that the audio part is a mp3 file and the video is a cdg file. For karaoke songs, that do not separate this (e.g. mp4 files), you can simply use mp4.
  • dir: Directory, where the karaoke files are stored.

Default configuration

config:
  key: ''
  last_song: null
  preview_duration: 3
  room: <Random room code>
  secret: <Random secret>
  server: https://syng.rocks
  waiting_room_policy: none
  mpv_options: ''
  show_advanced: False
sources:
  files:
    dir: .
    enabled: false
    extensions:
    - mp3+cdg
  s3:
    access_key: ''
    bucket: ''
    enabled: false
    endpoint: ''
    extensions:
    - mp3+cdg
    index_file: ~/.cache/syng/s3-index
    secret_key: ''
    secure: true
    tmp_dir: /tmp/syng
  youtube:
    channels: []
    enabled: true
    start_streaming: false
    tmp_dir: /tmp/syng

Server

If you want to host your own Syng server, you can do that, but you can also use the publicly available Syng instance at https://syng.rocks.

Python Package Index

You can install the server via pip:

pip install 'syng[server]'

and then run via:

syng server

Docker

Alternatively you can run the server using docker. It listens on port 8080 and reads a key file at /app/keys.txt when configured as private or restricted.

docker run --rm -v /path/to/your/keys.txt:/app/keys.txt -p 8080:8080 ghcr.io/christofsteel/syng -H 0.0.0.0

Configuration

Configuration is done via command line arguments, see syng server --help for an overview.

Public, Restricted, Private and keys.txt

Syng can run in three modes: public, restricted and private. This restricts which playback clients can start an event and what capabilities the event has. This has no bearing on the web clients. Every web client, that has access to the room code can join the event. Authorization is done via an entry in the keys.txt

  • Public means, that there are no restrictions. Every playback client can start an event and has support for all features
  • Restricted means, that every playback client can start an event, but server side searching is limited to authorized clients. For unauthorized clients, a search request is forwarded to the playback client, that handles that search.
  • Private means, that only authorized clients can start an event.

The keys.txt file is a simple text file holding one sha256 encrypted password per line. Passwords are stored as their hex value and only the first 64 characters per line are read by the server. You can use the rest to add comments. To add a key to the file, you can simply use echo -n "PASSWORD" | sha256sum | cut -d ' ' -f 1 >> keys.txt.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

syng-2.0.4.tar.gz (317.8 kB view details)

Uploaded Source

Built Distribution

syng-2.0.4-py3-none-any.whl (319.9 kB view details)

Uploaded Python 3

File details

Details for the file syng-2.0.4.tar.gz.

File metadata

  • Download URL: syng-2.0.4.tar.gz
  • Upload date:
  • Size: 317.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.13.0 Linux/6.11.7-300.fc41.x86_64

File hashes

Hashes for syng-2.0.4.tar.gz
Algorithm Hash digest
SHA256 082bf8f83c59884ae7eb3d70ddafc9a8c0c227c970c3d4ff5a3c483da5aeeba4
MD5 af5d790195e9eb24c8b1011e17cef8a0
BLAKE2b-256 118cc42c14c98c4a4abed9fa690dda6835deb00b0c948f34d4b49884226cea8a

See more details on using hashes here.

File details

Details for the file syng-2.0.4-py3-none-any.whl.

File metadata

  • Download URL: syng-2.0.4-py3-none-any.whl
  • Upload date:
  • Size: 319.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.13.0 Linux/6.11.7-300.fc41.x86_64

File hashes

Hashes for syng-2.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 739247630fa6eb8af5703c55c51b5e7a180456f048e22b1aa0433ccf90930500
MD5 a8fe27104ed65ef46139b73e72084eac
BLAKE2b-256 81cd493cd363921722b1e58f2d57680fd9109e57b3e532bb4bf8e17dfe1c9e88

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page