Skip to main content

An easy-to-use music extension for discord.py

Project description

discord-ext-music

An easy-to-use music extension for discord.py

Features

  • It's easy to use
  • Have all playback and playlist controls (skip, previous, seek, rewind, and etc..)
  • Thread-safe playback controls
  • Built-in equalizer and volume adjuster for PCM codec audio (pydub and scipy required)
  • Built-in thread-safe playlist
  • Can play most supported sources from FFmpeg libraries and it embedded into python! (PyAV required)

Installation

Python 3.8 or higher required.

You can install discord-ext-music directly from PyPI by the following command:

pip install discord-ext-music

If you want to have equalizer support do the following command:

pip install discord-ext-music[equalizer]

If you want to have miniaudio-based audio source support do the following command:

pip install discord-ext-music[miniaudio]

If you want to have FFmpeg-based audio source support do the following command:

pip install discord-ext-music[pyav]

If you want to have all optional dependencies do the following command:

pip install discord-ext-music[all]

Also, you can install development version by the following command:

git clone https://github.com/mansuf/discord-ext-music.git
cd discord-ext-music
pip install -U .[all]

Optional packages

  • scipy and pydub (for equalizer support)
  • miniaudio (for miniaudio-based audio source support)
  • PyAV (for FFmpeg-based audio source support)

Supported formats

Supported sources

  • Local file
  • All sources that FFmpeg libraries can handle (PyAV required)

Quick usage

API Documentation coming soon

from discord.ext.commands import Bot
from discord.ext.music import MusicClient, WavAudio

bot = Bot()

@client.command()
async def play(ctx):
    voice_user = ctx.message.author.voice
    music_client = await voice_user.channel.connect(cls=MusicClient)
    track = Track(
        WavAudio('audio.wav'), # AudioSource
        'This is audio' # name
    )
    await music_client.play(track)

bot.run('token')

Example

Bot example are available in directory example/bot.py

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

discord-ext-music-0.1.0.tar.gz (18.7 kB view hashes)

Uploaded Source

Built Distribution

discord_ext_music-0.1.0-py3-none-any.whl (22.2 kB view hashes)

Uploaded Python 3

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