Skip to main content

A Discord voice library using Python Songbird bindings.

Project description

⚠️ This library is on lifeline support and I am looking for a new maintainer. Please DM me if you are interested.

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

Uploaded Source

Built Distributions

songbird_py-0.1.9-cp310-none-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.10 Windows x86-64

songbird_py-0.1.9-cp310-cp310-manylinux_2_34_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.34+ x86-64

songbird_py-0.1.9-cp310-cp310-macosx_10_9_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

songbird_py-0.1.9-cp39-none-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.9 Windows x86-64

songbird_py-0.1.9-cp39-cp39-manylinux_2_34_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.34+ x86-64

songbird_py-0.1.9-cp39-cp39-macosx_10_9_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

songbird_py-0.1.9-cp38-none-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.8 Windows x86-64

songbird_py-0.1.9-cp38-cp38-manylinux_2_34_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.34+ x86-64

songbird_py-0.1.9-cp38-cp38-macosx_10_9_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: songbird_py-0.1.9.tar.gz
  • Upload date:
  • Size: 130.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for songbird_py-0.1.9.tar.gz
Algorithm Hash digest
SHA256 6faa7293dae21126ffbc5b93f7aa8bc5f1398e8116336183b5932f18f05cecef
MD5 8d7401b51831958413f9a00ede04c940
BLAKE2b-256 e9d97ff3fada06c4f73e32ceb1aa6d7cb7b890691fb495316a7449b6bdf8e21b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for songbird_py-0.1.9-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 283ed6d3e8fce060aeb1b97a63e8bf3ca607039491cb8558dfcf6aaa4546fc7c
MD5 9ab638842700ccb21cc8b02fb0a02cde
BLAKE2b-256 ec7b1d3839ec4a7451ca0d0c191bdcbb1fbf6b646c2916669c491a160279bed8

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.9-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for songbird_py-0.1.9-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 9f498b4b1e73ae26dba12e37f3e0da6f175bbd9b504d26854995c10e24354f93
MD5 2f317318907776e40d507864e85596d2
BLAKE2b-256 5c9052e2f237c2a6f7279f9c012a09c44ee2f4d43f70e94fcb92db17f8b33015

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for songbird_py-0.1.9-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4cc24104eba0013e591c58f6eadf745056b1c0ca2a03baebe17b7988e368832e
MD5 fe4c65a6d2e4966a62306adb136803d2
BLAKE2b-256 944d6f0a49af6cc839aeff15c719e0f5ae4fb719b7f7e8dea68327f0189f3ae0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for songbird_py-0.1.9-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 3a92864adc1559c05a8ddf6aedce43758440a740a07846178155c8e359edcd34
MD5 f1368121bd09e57a46ed8914759c868a
BLAKE2b-256 4c0e324449d361b613577b53598502191b7d2b505ba0762d7775b45e90fc740c

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.9-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for songbird_py-0.1.9-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 05ddd55ee4e0803b14f067032fce6f0597086f8d552ad5545d076ec1f424df24
MD5 b1b09e0a6d020043dae191ac5085efae
BLAKE2b-256 d82a5ad3556303ba7b1bc7819eace04587888c6090d210c0eb589ff4ae96d0eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for songbird_py-0.1.9-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1a4e3f08aa717c709df957776aa656feddf477a8fae7eb957c8069c425ad3cfe
MD5 0a37fa5cd6b044b46c8764f14667f392
BLAKE2b-256 459ed9a4b7812b3c3c1cb5588559581a1a175609f0cc9e03cd2049cca0280264

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for songbird_py-0.1.9-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 153c36acb3a101d94cbdaf5726fa9ab83f7f656fc315d7ea89c739b18261d3dd
MD5 7b03a556ab578060f9bfabf9c69a6aba
BLAKE2b-256 8b1bb4e2ed44517cc6a087eabf05945b782aec45e57a4c80a2d0a313c19800a1

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.9-cp38-cp38-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for songbird_py-0.1.9-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 256d12f8ebbff3d9177ce7485c5acda8cb4ab0c34b808016d3c4f1885fea166a
MD5 9576fb2f226e97bf31c6a1bf8b06fc87
BLAKE2b-256 0b2106961ace76ecc77e377c2d683b6ac80ecd5276b3e17f47ea68c07e7f1db7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for songbird_py-0.1.9-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f44e8c3031b1acf74332d546b7ec28984a677f1635e2f1c2a9933be0a7f08524
MD5 40bc8c527024a1be6afbf56980d57310
BLAKE2b-256 c6fc1bae9b039982e1ec9a774b26c5ff06a4897243c952579977ada494df6048

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