v0.0.6\nplay_audio fixes

This commit is contained in:
bot
2024-03-07 02:18:09 +03:00
parent d75add614b
commit 53939b4bc3
22 changed files with 1126 additions and 1104 deletions

View File

@@ -1,17 +1,17 @@
from .Logger import logger
from asyncio import sleep
from disnake import FFmpegPCMAudio
async def play_audio(audio, bot, vc):
if not bot.voice_clients:
logger.info(audio)
logger.error(f'Playing: {audio}')
await sleep(1)
vp = await vc.connect()
if not vp.is_playing():
vp.play(FFmpegPCMAudio(f'{audio}'), after=None)
while vp.is_playing():
await sleep(0.5)
await sleep(1)
await vp.disconnect()
from .Logger import logger
from asyncio import sleep
from disnake import FFmpegOpusAudio, opus
async def play_audio(audio, bot, vc):
if not bot.voice_clients:
# logger.info(audio)
logger.error(f'Playing: {audio}')
await sleep(1)
vp = await vc.connect()
if not vp.is_playing():
vp.play(FFmpegOpusAudio(f'{audio}', executable='ffmpeg'), after=lambda e: print('done', e))
while vp.is_playing():
await sleep(0.5)
await sleep(1)
await vp.disconnect()