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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.9 Windows x86-64

songbird_py-0.1.4-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.4-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.4-cp38-none-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.8 Windows x86-64

songbird_py-0.1.4-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.4-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.4.tar.gz.

File metadata

  • Download URL: songbird_py-0.1.4.tar.gz
  • Upload date:
  • Size: 115.8 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.4.tar.gz
Algorithm Hash digest
SHA256 a3ae6677887afff66b33a020b1024e9fa5a0b78a340e6d3841a48a774d312c99
MD5 185015365ced39f0aedd6aa3cf35560e
BLAKE2b-256 efd1f936284152de165652d4d123c388e598d02bce85d40859fa1d852d939cb4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.4-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.4-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 fde1740dbe43e82abb168ae04cbc0f8796e97c5e6e2e87c8d54b29ae4d07f13c
MD5 69ab1d3ba8b08b7bbb4c1c5f748beb61
BLAKE2b-256 d7a3ee076fe5bde2eca801ad114a158426bed5d4de836a9591a5a0733ed9bb59

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.4-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.4-cp310-cp310-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 8e554c09191d5490c71b770fa5ab305da8aedb17634c47325415271bc8315ec0
MD5 2260ad565e645584578e827994ceb2b9
BLAKE2b-256 bae5ea6e24a1feda86a406f8e4ab8dcc5b887b9dd0c9d4f594de4651bd65f132

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.4-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.4-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 51d5d149e5ce4ecc1b14868d578040638763e14234c160822a0195365b3007b2
MD5 d9729f719dff6ce06060766a58f771c8
BLAKE2b-256 0d3a424a8af78497e900f4f2707ac59b555cd959739ba2b690ac250b64cd47be

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.4-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.4-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 caf02ee00149c9c8ae43c8abc2f0d1ad55368b2fd2db209ca7516c23a9efe57e
MD5 14c20285c6c86a26417561058cec2f1f
BLAKE2b-256 1d3c85d094538efc0c35b064a6651989ebda9c4e42856697842ad5e3d5859de6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.4-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.4-cp39-cp39-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 2c5b544ece07803b06271fd364f3bc9151d263bed5a5d05bd2b6d09a7aaa2976
MD5 4c1a862852a9ae77e62a945dbfd4f11c
BLAKE2b-256 3e70eb9529b78955fc4e3235700ec2f22a765b8ab3b4ed58dbf45eea99f03489

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.4-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.4-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 755127a2f7416e53bfd9dac7c17677a18046346cc05bd5906b2eae996c1f084c
MD5 e26767cb44bf2e470c9ea2b91298a5a7
BLAKE2b-256 ea008f7b3dd400391a31e2b62f0a7d70d325f46247e2d8c6baa495815e91df0c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.4-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.4-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 9790df02f5a68b03efe43eda723dedb2fb89f66f74d47faa7444b60c22edeb69
MD5 10e31ffae59aa54dd533890c29b42624
BLAKE2b-256 333bc803f61e019a2d8f387495002ca46179075e5898401d56c7b791a96f0fae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.4-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.4-cp38-cp38-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 f74c3701db32a09d77807157f4eccf19d28246ddca147e900b76621b6934631a
MD5 43aad03c6fdbb12188cfca3529e2cd00
BLAKE2b-256 f89ff9369458bb34a4e5e3e963e83eef015de305ddf25c3a520a51592965e025

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.4-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.4-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 92335f14f6010c454e07159a100b519b15f224c6947bb6e288d08e1a339d89a3
MD5 8db6062628e25f4317ce481ccb7e68af
BLAKE2b-256 38fd0b2d582e35074c0e21a375b42eacc7d59b04b9f1dfef7859ec6e88e34c91

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