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
- Raw PCM
- WAV
- MP3 (miniaudio or PyAV required)
- FLAC (miniaudio or PyAV required)
- All formats that vorbis encoded (miniaudio or PyAV required)
- All formats that FFmpeg libraries can handle (PyAV required)
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, Track
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for discord_ext_music-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f7c89fc42094ccfd7c0b1b73aa70cb39b11feeaf9e59f1bac0795c2a2384aca |
|
MD5 | 03bb3724b478b2347528293e851121f5 |
|
BLAKE2b-256 | 9b2622435b97633489fd3bec8b388fa64a422290f900bccb7b6ff7ddd07ac5e7 |