Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: VoiceClient.is_playing() returns True even when the bot doesn't reproduce audio #882

Open
3 tasks done
Snipy7374 opened this issue Nov 2, 2022 · 0 comments
Open
3 tasks done
Labels
t: unconfirmed bug Type: bug - needs testing on if this is an issue

Comments

@Snipy7374
Copy link

Snipy7374 commented Nov 2, 2022

Summary

When forcily moving the bot into another VoiceChannel during an audio reproduction VoiceClient.is_playing() returns True even if the bot is not reproducing any sound. I haven't still checked if this issue affect other classes too but there could be other bugs. I've also noted a huge retard while the audio reproduction start, other fork of d.py (like disnake) doesn't seem to have this retard (its length is very variable)

Reproduction Steps

  • Connect to a VoiceChannel
  • Play something with a FFmpegPCMAudio audio source
  • Move the bot into another VoiceChannel

Minimal Reproducible Code

@bot.command()
async def lmao(ctx):
    channel: nextcord.VoiceChannel = await bot.fetch_channel(874005538285977603)
    vc = await channel.connect()
    vc.play(nextcord.FFmpegPCMAudio("https://github.com/ninjamuffin99/Funkin/blob/a083938ac803a91fbb15f03e432dea620f8a3b4a/assets/songs/bopeebo/Inst.mp3?raw=true", executable="C:\\Users\\davil\\OneDrive\\Desktop\\ffmpeg-master-latest-win64-gpl-shared\\bin\\ffmpeg.exe"))
    for i in range(40):
        print(f"[{i}] playing: {vc.is_playing()} paused: {vc.is_paused()}")
        await asyncio.sleep(1)

Expected Results

VoiceClient.is_playing() should return False, i think that's a problem with the audio Thread for the value of VoiceClient.is_playing() (relying only on the Thread to know if the audio is playing doesn't take in account possible external interruptions, i mean from discord client side, moving the bot in another VoiceChannel doesn't stop the Thread from playing so that's the problem probaly) and maybe there's a problem with package sending, while the bot change VoiceChannel after some few second it should continue to play the Audio (right? or is this a discord api limitation?)

Actual Results

VoiceClient.is_playing() return True no matter what happens on client side

Intents

Irrelevants

System Information

nextcord v2.2.0

other information are irrelevants

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

@Snipy7374 Snipy7374 added the t: unconfirmed bug Type: bug - needs testing on if this is an issue label Nov 2, 2022
@Snipy7374 Snipy7374 changed the title bug: VoiceClient.is_playing() returns True even when the bot doesn't reproduce audio (most likely there are some problems with packet loss?) bug: VoiceClient.is_playing() returns True even when the bot doesn't reproduce audio Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t: unconfirmed bug Type: bug - needs testing on if this is an issue
Projects
None yet
Development

No branches or pull requests

1 participant