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.3.tar.gz (113.1 kB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.10 Windows x86-64

songbird_py-0.1.3-cp310-cp310-manylinux_2_24_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.24+ x86-64

songbird_py-0.1.3-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.3-cp39-none-win_amd64.whl (2.3 MB view details)

Uploaded CPython 3.9 Windows x86-64

songbird_py-0.1.3-cp39-cp39-manylinux_2_24_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.24+ x86-64

songbird_py-0.1.3-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.3-cp38-none-win_amd64.whl (2.3 MB view details)

Uploaded CPython 3.8 Windows x86-64

songbird_py-0.1.3-cp38-cp38-manylinux_2_24_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.24+ x86-64

songbird_py-0.1.3-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.3.tar.gz.

File metadata

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

File hashes

Hashes for songbird_py-0.1.3.tar.gz
Algorithm Hash digest
SHA256 200536d983d3e1856677c997376754ef3df339ae34a9a6947f9d665208837a07
MD5 b7a7e9ae7230e6bac203d7f95e6ddd28
BLAKE2b-256 a5388e5cf1c5133ea8875d03331cfbbe863518899aa54b90bbf84a8107d6c485

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.3-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.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for songbird_py-0.1.3-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 c0df2b77a51f252baebff19ab7367001e9135934a4a5ad988e78295bd810acac
MD5 3fab2d44c8b1b900a9106e8f94de1eea
BLAKE2b-256 c4ab4521a291113b695e7870c16ce8868a45bdfa86ca4a3fdf1d0ef1d6a42755

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.3-cp310-cp310-manylinux_2_24_x86_64.whl
  • Upload date:
  • Size: 4.0 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.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for songbird_py-0.1.3-cp310-cp310-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 f00031c6bd91dd6c6401e7d96255b9a8b08a8a784efff63aa5e09f8bccc44458
MD5 f55056bf429364a43ebc7dc1d3dab3aa
BLAKE2b-256 617c556345e45bc8396d987649e98e3a5eef840ca4277cb487575df90ec7ddf9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.3-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.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for songbird_py-0.1.3-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f1cc225417981633c5d6a3ed778372510f52947a21f27ca6d1c6dc65fc368065
MD5 573aa99de1e9f840f2f3b0464ed5e4d9
BLAKE2b-256 3c3c9aa049c5eb91167d06224cf28393cefdf8176fc5ce14181c389c064a97ba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.3-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.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for songbird_py-0.1.3-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 ef0b0dc041956d72dabc1a706bfe37d91b199e4b5440c6f8256d2f3edc5df6ab
MD5 6a018c802f0157af2117333c3b49a7c4
BLAKE2b-256 ecd6052b0af3b7105b94d3dd6cddd7f2f44284cad3b6dc96454f56f09e3f59d5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.3-cp39-cp39-manylinux_2_24_x86_64.whl
  • Upload date:
  • Size: 4.0 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.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for songbird_py-0.1.3-cp39-cp39-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 8c63f9374abae8830d71da6dfdbcd739c302bc129c9ccfb4bccb6a237c1a76c1
MD5 6d854070f59c7c391351fa3466ed36c1
BLAKE2b-256 8c45f57208a55d5e60d32521f5ec6788c67d505aa033ea9ec377916fa5a7cf07

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.3-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.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for songbird_py-0.1.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 77d095336028c410e1dd781ed0323c61666a180992ab28a7c7aca0fedb09993c
MD5 80acc7895f8163357b03912438b40ff3
BLAKE2b-256 9ec932399f5a07c9c2ff90a6527f0ed2f59b2b197177e956eaeb463519ac0268

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for songbird_py-0.1.3-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 a4cfae2730d8a2811375fce69de915068d562cc5105697ef0308bd9b7f15a5d0
MD5 b08452b2f17ee7829297985a712e6b93
BLAKE2b-256 64df6861d442e72c7b19f6beab19f07e6a2e98b71e5d5b7a910d996bfd51c729

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.3-cp38-cp38-manylinux_2_24_x86_64.whl
  • Upload date:
  • Size: 4.0 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.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for songbird_py-0.1.3-cp38-cp38-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 c9547e556222c516c0a83f3856d16bd51c8b3e4aec3ff098c9becd938abdc234
MD5 01d152bda57dec19777b4431f881c668
BLAKE2b-256 57d997874df3882ddf67c353431cca4d224f81f360e167c1e988ed991a864a65

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.3-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.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for songbird_py-0.1.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b540ff697ee726d5f97cd0a08858ea16430a4b916c507eb496a13b121015d2b3
MD5 7cbd2eed6095890fb34d72ca090bdc68
BLAKE2b-256 24ea464eefebeb20606857ffafcb35e210ce6af35d6c78207ebcbb9389f3869b

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