Skip to main content

A Discord voice library using Python Songbird bindings.

Project description

Songbird-Py

Songbird bindings for python. The goal is to provide an easy to use alternitive to Lavalink. Its written with rust-bindings to Songbird.

Songbird-py Docs

Dependencies

This library requires Opus to be installed. ffmpeg functions also require FFmpeg to be installed.

Building Source Dist

If you are not on windows, macos, or linux x86_64 or need to use a version of python different than 3.8-3.10 you will need to build the source dist. The only change to the installation process is that Rust will need to be installed before installing from pip.

Playing a Song

Once you are connected to a channel, playing music is extremely easy.

from songbird import ytdl

# `voice` was created from a connection to the gateway.

track_handle = await voice.play_source(await ytdl("https://www.youtube.com/watch?v=r25MAkzkTF4"))

await sleep(5)
# Doesn't need to be awaited!
track_handle.pause()
await sleep(5)
track_handle.play()

Supported Libraries

Hikari and Pincer are currently the only supported libraries. See the examples directory for more information.

Using with your own Gateway

from asyncio import run
from songbird import Driver

async def main():
    voice = await Driver.create()
    # `server` is the server payload from the gateway.
    # `state` is the voice state payload from the gateway.
    await voice.connect(
        token=server.token,
        endpoint=server.endpoint,
        session_id=state.session_id,
        guild_id=server.guild_id,
        channel_id=state.channel_id,
        user_id=state.user_id
    )

run(main())

Contributing

Pyo3 asyncio is used with tokio.

Dependencies

Maturin should be installed though pip. This is used to build the Rust code to a python lib. Run command maturin develop when changes are made to the Rust src.

pyo3

pyo3 docs

pyo3 asyncio

pyo3 asyncio docs You can also look at the async secion of the pyo3 docs.

Songbird

Link

docs

Its a good idea to install all the dependencies.

Goal of the project

Create API for songbird driver and everything that is needed with it it.

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

songbird_py-0.1.5.tar.gz (115.9 kB view details)

Uploaded Source

Built Distributions

songbird_py-0.1.5-cp310-none-win_amd64.whl (2.3 MB view details)

Uploaded CPython 3.10 Windows x86-64

songbird_py-0.1.5-cp310-cp310-manylinux_2_24_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.24+ x86-64

songbird_py-0.1.5-cp310-cp310-macosx_10_9_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

songbird_py-0.1.5-cp39-none-win_amd64.whl (2.3 MB view details)

Uploaded CPython 3.9 Windows x86-64

songbird_py-0.1.5-cp39-cp39-manylinux_2_24_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.24+ x86-64

songbird_py-0.1.5-cp39-cp39-macosx_10_9_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

songbird_py-0.1.5-cp38-none-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.8 Windows x86-64

songbird_py-0.1.5-cp38-cp38-manylinux_2_24_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.24+ x86-64

songbird_py-0.1.5-cp38-cp38-macosx_10_9_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

Details for the file songbird_py-0.1.5.tar.gz.

File metadata

  • Download URL: songbird_py-0.1.5.tar.gz
  • Upload date:
  • Size: 115.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for songbird_py-0.1.5.tar.gz
Algorithm Hash digest
SHA256 dc4abd03fc8e8d318eda9f83381017d0be0aece9cff174cbaa6a60b192d1eb01
MD5 f6b0c4dfd04407e9afe217a6426537fd
BLAKE2b-256 77637a84035b2711d7eeeef4cf1e117c8fac5558a63e585eaf74b0ea54852b79

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.5-cp310-none-win_amd64.whl.

File metadata

  • Download URL: songbird_py-0.1.5-cp310-none-win_amd64.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for songbird_py-0.1.5-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 1a58dc3f25eabb5719bb879d992ea589dd7dd4833c2abad3f42747d60582655f
MD5 c12c5f3b88617ffc588858c0c4bdf86c
BLAKE2b-256 4033a2ab48e75a886c73d207e468004481e5c937968d7092eebc32c289b6cc94

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.5-cp310-cp310-manylinux_2_24_x86_64.whl.

File metadata

  • Download URL: songbird_py-0.1.5-cp310-cp310-manylinux_2_24_x86_64.whl
  • Upload date:
  • Size: 4.1 MB
  • Tags: CPython 3.10, manylinux: glibc 2.24+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for songbird_py-0.1.5-cp310-cp310-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 e304a78d39b77174cd9dac5b6de05345dc205eec1222b5f042ab5956fedafaac
MD5 56dca3ac3c2a2dc2a7e303f93ad5148f
BLAKE2b-256 b06313258beef710e65c206dce2055a8f9ff5c7deda2787f9be0a36fb9e6a97c

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.5-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: songbird_py-0.1.5-cp310-cp310-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: CPython 3.10, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for songbird_py-0.1.5-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5261887451e6a3ad0a94c4795e7c98f2e788de2dd397d4ea17f0ec6e7cb5f608
MD5 d694ef0fa793fe842d913412e85172f3
BLAKE2b-256 1c2cb18101113fe619f698bcdeb8f404635ba51a951e4b18b676b8b451f381e8

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.5-cp39-none-win_amd64.whl.

File metadata

  • Download URL: songbird_py-0.1.5-cp39-none-win_amd64.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for songbird_py-0.1.5-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 b5d8c6ee5e7562aea10c89a6e2f90cf3de5a4f31a3163f588e36b4ea4b22228e
MD5 c628c0bcf1a0b27f8cbbd6a79750f606
BLAKE2b-256 58810e79a189baa9065d33f9742d6e4283acd028bd5d35f5fcb95e8e8ffc9265

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.5-cp39-cp39-manylinux_2_24_x86_64.whl.

File metadata

  • Download URL: songbird_py-0.1.5-cp39-cp39-manylinux_2_24_x86_64.whl
  • Upload date:
  • Size: 4.1 MB
  • Tags: CPython 3.9, manylinux: glibc 2.24+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for songbird_py-0.1.5-cp39-cp39-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 999115fdf4e99ea4514eb2c8b9f2f0ebf89cddf8bf358f354e3ed2ad5aa2b618
MD5 06ceefcb4b290dd256369d14c1aea958
BLAKE2b-256 85c128c7390c56b3b0173d1e437e0c877c9f90cde2db6ae6e230d27aa5f63479

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.5-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: songbird_py-0.1.5-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for songbird_py-0.1.5-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 09fe93c48d144f879e9272154abee849bd8e4c2a55dad357461bdd3e7fe096bc
MD5 e22016014eee0981e1865a489c2ae46e
BLAKE2b-256 5051fe81ec15e40f6de84dd6f3611cd69a607b1f79a19190b0bd2a2f266d2ae4

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.5-cp38-none-win_amd64.whl.

File metadata

  • Download URL: songbird_py-0.1.5-cp38-none-win_amd64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for songbird_py-0.1.5-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 5802626d9c6c4dc413fea4d1c94dcd8268e905be4252fc5c580adda2bd645b39
MD5 3760c3f46c9708e5c7df0b79671f35d3
BLAKE2b-256 61023c879ef9bbb308b38bcb8c83c3d7364a5341d8f40237b59f5f182a3d171f

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.5-cp38-cp38-manylinux_2_24_x86_64.whl.

File metadata

  • Download URL: songbird_py-0.1.5-cp38-cp38-manylinux_2_24_x86_64.whl
  • Upload date:
  • Size: 4.1 MB
  • Tags: CPython 3.8, manylinux: glibc 2.24+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for songbird_py-0.1.5-cp38-cp38-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 86219e2c9e4e3d1f4a4b0bdc82af47f77946a143da149d1d298f3e3b7dbe9baf
MD5 2bdc17266863744f58af2214973c8442
BLAKE2b-256 82ff7533d024abf8d964c0fbcbd253334265d1704d8459569f9181058dc34ff3

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.5-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: songbird_py-0.1.5-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for songbird_py-0.1.5-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 60e9d6ed4861652a0ddaf03f4d09d3d3c8d7b9d8f400052eb17b75581b4d1dfb
MD5 f848dd05cbf19dbd893aa03f9984f449
BLAKE2b-256 63dbf9d586113db4d1bd246ebcfabec94b61a41fa187c17be4c12b563a11d689

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