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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.8 Windows x86-64

songbird_py-0.1.2-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.2-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.2.tar.gz.

File metadata

  • Download URL: songbird_py-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 aa54aefda3d58c4c743fd99de01cb7d04e499e224a21700091e4588459e62c08
MD5 66086bf0a338da29dc0681edacb91770
BLAKE2b-256 15e59dec4bde4f3535fb30e06bdb609dc5da146f1fd68f7ea758792c9a50b971

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.2-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.2-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 49dd6a5f013f810998efea0ceff55b722aed72b58dbb6dcce868733f50a08372
MD5 b680b72cfc51cc8d0195ebe858dcee6e
BLAKE2b-256 8d70c77ccd3fdc7d6a73d68220853a1764c0b3b9549950780b43d8c005939b74

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.2-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.2-cp310-cp310-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 8259c87b989439683b1035c85d6a177a4e79470704ac80222e905e9887e4e7d3
MD5 715e4e198b3a1ba2a4876c02436b5b93
BLAKE2b-256 06e6556f115ed65e85c1aed0d9af82cac6cde2e00cdcf60ce97b2ec474e58f1a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.2-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.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 717be4b6aefdb04140952befcaf3baf1df2828deadd85a0aa501bbd1fea7609d
MD5 6455f1080b3480c73a8caae9b8f9e9c5
BLAKE2b-256 aed9cb615f0dade9e88def8154eadf469301fc0e73fc2e0ab48185bb0d6b5166

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.2-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.2-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 d777928d1790a04693152bb19085eca9235dda6616b571fbc1aeb38f85bc7bd7
MD5 21eb67156ef92335f94ad49a70ee0c2e
BLAKE2b-256 2dc178a6bd1b09e6d7fff1ba3d6551318c444c864327eaf786fe4a472cfe0e37

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.2-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.2-cp39-cp39-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 6ce276325330db82084a27dcfef9d3af13ac1f56c75e0c0142a1c6193c07d682
MD5 f4aae0a7fb93c176dc10cb50f3cc239e
BLAKE2b-256 156ba3a7dbcf67422da79f944b3d84735d5643affb01aa5a9fe8e484a7367a50

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.2-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.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6650af34501176d35194da256899c091565236b595a9750b68cc8dc117dffc47
MD5 c69d8fd43bd7a76e8a8088b3d08a245c
BLAKE2b-256 9c21bed5351ef69f8da7e09cffd65e1c2f66a3b7ac6a62620e49a4bd145d3f1c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.2-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.2-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 b8379a8556a2ceaa42c817788ab340ee6d364edce6d5cba7b6fa4e1cf05ae2d1
MD5 711b2b8de1db6576a1415d0cf576c4f4
BLAKE2b-256 c0fad2bfb2ab95b164e3597e2781a21b0825b3a3ff3960a4cd3294ac27bbbc69

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.2-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.2-cp38-cp38-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 72017cbac76d61b25645589ee6871c0222f0ba7725ca71af35d540d6cdd796f6
MD5 565f3257597db053706f32af4af9a311
BLAKE2b-256 28f696f7efb92ce5834b6bc33fe6bf367ce1c11d684a5f7026fe48495b83448b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: songbird_py-0.1.2-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.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7ecf03dc55fb15fd72036e5441da6174cf104b5174645f571262fd50835de376
MD5 6cbe6b69e2dbf85f9d3e83bcd8f7dfae
BLAKE2b-256 b2f4bcf426dcde543cf70170386671061509e19bbe7c77ec384eaff20e6178fc

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