av-discord
PyAV audio sources for discord.py, pycord, and disnake
Installation
Stable version (PyPI)
# For Windows
py -3 -m pip install av-discord
# For Linux / Mac OS
python3 -m pip install av-discord
Development version
NOTE: You must have git installed. If you don't have it, install it from here https://git-scm.com/.
git clone https://github.com/mansuf/av-discord.git
cd av-discord
python setup.py install
Usage
from discord.ext.commands import Bot
from avcord import setup_av, AVPCMAudio, setup_encoder
# Do setup
# Use `setup_av('disnake')` if you're using disnake library
setup_av('discord')
bot = Bot()
@bot.command()
async def play(ctx):
voice_user = ctx.message.author.voice
vc = await voice_user.channel.connect()
# It is important to call this function before play audio
# to avoid "Segmentation fault" error
setup_encoder(vc)
source = AVPCMAudio('audio.webm')
vc.play(source)
@bot.event
async def on_ready():
print('READY')
bot.run('token')
Metadata
Release files for av-discord 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| av-discord-0.0.1.tar.gz | 6.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| av_discord-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.5 kB
Release files / av-discord-0.0.1.tar.gz
| Download URL | av-discord-0.0.1.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
71c8f029a79d74d21e41b06a96a76bc2aa69bf55f572cb245de5e4a86a468faf
|
|
BLAKE2b-256 checksum How to use checksums |
2abdb004b699d62d76a94af60edff0c9341e64c8d7f51b92a3b1020deb0d8bdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / av_discord-0.0.1-py3-none-any.whl
| Download URL | av_discord-0.0.1-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9b56b0aa149cf60e92fe55fd16108692114f83864e0e451c7c313ee3c8fde89e
|
|
BLAKE2b-256 checksum How to use checksums |
db50d05a61043fc4589cb4b772fd933a3372d01531bab49d4b2ddd7833ecfd2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|