Metadata-Version: 2.1
Name: av-discord
Version: 0.0.1
Summary: PyAV audio sources for discord.py, pycord, and disnake
Home-page: https://github.com/mansuf/av-cord
Author: Rahman Yusuf
Author-email: danipart4@gmail.com
License: MIT
Keywords: discord,audio
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Provides-Extra: docs
License-File: LICENSE

# av-discord

[PyAV](https://github.com/PyAV-Org/PyAV) audio sources for [discord.py](https://github.com/Rapptz/discord.py), 
[pycord](https://github.com/Pycord-Development/pycord), 
and [disnake](https://github.com/DisnakeDev/disnake)

## Installation

### Stable version (PyPI)

```shell
# 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/.

```shell
git clone https://github.com/mansuf/av-discord.git
cd av-discord
python setup.py install
```

## Usage

```python
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')
```
