discord-ext-voice-recv icon indicating copy to clipboard operation
discord-ext-voice-recv copied to clipboard

"discord.ext.voice_recv.opus: x packets were lost being flushed in decoder" causing wav file to be output incorrectly

Open CattoYT opened this issue 1 year ago • 7 comments
trafficstars

When packets are flushed, the output wav file seems to speed up and skip audio sections Example files: https://drive.google.com/drive/folders/13TclkKZRA6_9nm_jJvg3-T3WSgENQeKJ?usp=drive_link

This also seems to happen with WaveSinks, so I'm not quite sure that its my code acting up.

What I'm currently doing is writing all of the received VoiceData to a bytes() and then using Wave_write.writeframes to create a wav file with the bytes.

Is this intended behavior, and if so, is there a way around it?

CattoYT avatar Feb 11 '24 18:02 CattoYT

I still haven't fully hammered out how the packet flushing/teardown semantics are going to be. Since there's no equivalent function on the dpy voice send side of things I have to figure out if/how I want to expose it. There's a bit more design and testing to do on my end but at this point no, problems are not "intended", but for this issue in particular I don't think I have anything for you just yet.

imayhaveborkedit avatar Feb 11 '24 19:02 imayhaveborkedit

no problem, I understand that this is probably a lot more complicated than what appears, so please take your time!

CattoYT avatar Feb 11 '24 19:02 CattoYT

Hey there.. any update?

realcoloride avatar Mar 31 '24 15:03 realcoloride

I've figured out what's causing this. The sequence rollover handling logic is a bit buggy causing it to erroneously drop packets. This will be fixed in due time.

imayhaveborkedit avatar Apr 11 '24 21:04 imayhaveborkedit

About time haha! Good luck

realcoloride avatar Apr 11 '24 22:04 realcoloride

Apologies for the necropost, but are there any updates on this yet?

CattoYT avatar Sep 26 '24 20:09 CattoYT

Unfortunately not yet. I've been fairly busy lately and in the middle of working through the issues in this I ended up putting this aside for some time. At the moment im still a bit busy but I'll try to see if I can sort this issue out quickly or if I need to put more work into it.

imayhaveborkedit avatar Sep 26 '24 20:09 imayhaveborkedit