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.

:warning: The static-ffmpeg package on pypi does not work

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

Uploaded Source

Built Distributions

songbird_py-0.1.7-cp310-none-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.10 Windows x86-64

songbird_py-0.1.7-cp310-cp310-manylinux_2_31_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.31+ x86-64

songbird_py-0.1.7-cp310-cp310-macosx_10_9_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

songbird_py-0.1.7-cp39-none-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.9 Windows x86-64

songbird_py-0.1.7-cp39-cp39-manylinux_2_31_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.31+ x86-64

songbird_py-0.1.7-cp39-cp39-macosx_10_9_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

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

Uploaded CPython 3.8 Windows x86-64

songbird_py-0.1.7-cp38-cp38-manylinux_2_31_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.31+ x86-64

songbird_py-0.1.7-cp38-cp38-macosx_10_9_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: songbird_py-0.1.7.tar.gz
  • Upload date:
  • Size: 116.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for songbird_py-0.1.7.tar.gz
Algorithm Hash digest
SHA256 a027ab9143c6e844a9aaea24e6f1f431e1b080f3a5ba8d7f187e1937fcf574cb
MD5 1f1ed61b8bc9dc72094fd85b67fda858
BLAKE2b-256 ac89f5fa9cd3644cdd9d889103d768a648e34c2507b76833f19939802896e068

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for songbird_py-0.1.7-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 d35a803c3c52cdbd01c699beffaf3c98be1cf977b2af7aa8eb41f25e7793d75c
MD5 0e12d6ddce5fc5ea89464c21f734ea29
BLAKE2b-256 0210d73980b35ffc97af3c55a71ab4a43f3300097705c11a40913ea238a3d8de

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.7-cp310-cp310-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for songbird_py-0.1.7-cp310-cp310-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 6e0c667b94ee49792ab06a97b854617aced74ad9bd336f5a0b90cbdc3739bb11
MD5 3c12868f62105232bd0811546054b855
BLAKE2b-256 f3cce9a9b0f0c17e8c1644cb0a98662e5b4fc8b0786738f49748ecddaa364f1d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for songbird_py-0.1.7-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 319f1e726aebe3cd191736022c51b3149fd5612093da681838805eeae6bedf37
MD5 4c473cdf380e0d4d9aac3ca87e57ea66
BLAKE2b-256 427c8a731373fb0f8599f22f516b738a8d20aac3f763f6ab362c3f00a865ff4c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for songbird_py-0.1.7-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 4aaa9460055b07323130d8ea39b0eb37630956131ff16e68cd9919bae7670256
MD5 7678bbcb36eed8084e26d190b065af6c
BLAKE2b-256 3be67a8d27cccfa27d6dd85f88b022c9e89e20c949d5e91719e016202c9e78bd

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.7-cp39-cp39-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for songbird_py-0.1.7-cp39-cp39-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 c5f35ce822209f12171c6f664184e81e41ea18ee8ce4dc1888bed2d10eb7889f
MD5 49b1a3981537fe9560833356dc661891
BLAKE2b-256 5ca6e134f7b57f15a7faed415cbc2b32731396399128f67fd68cee2755100ad7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for songbird_py-0.1.7-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 360a0c6f0c3bf99df809c180ead029a3603364d8647c2f9214d4e5b71dc1c14b
MD5 66d4ae77acc0e2774063dd4ea654a7af
BLAKE2b-256 440122ebb9ba83c2b9c585bdfb856dc1712ca124d3ff01b57232a75abab8d2ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for songbird_py-0.1.7-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 c475e87264b4a899ab704c79286fa56d4220a6bb3ebf6afa2c8dfe0bc625b1b4
MD5 016bd28b8bfc52acd0dd1ba95fe17aa9
BLAKE2b-256 d30373d2fcb6d843255afb97cc9c32dc432738f7c10f084f00592b838dcfea76

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.7-cp38-cp38-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for songbird_py-0.1.7-cp38-cp38-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 46b9f37eca6eff9c82821331276a089734a261e8c36e47368785dccb984d7ef4
MD5 9dec085915e78ddb6dfc8ec8a2639d66
BLAKE2b-256 6c64ab8d27f0d5756d7e7a7801834eede1c510eb7c9587dedd070aae3500c25b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for songbird_py-0.1.7-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 17ae594ed750ec5362c219a634366a73bf7f2f5417e541f677c56239c56e5c13
MD5 025ffcddf322ec868d532c085155f307
BLAKE2b-256 cc358cfce2d52e098ae5764daef19700f0bd252117bf50de911ca5bab88e9c5d

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