Does receiveVoice still work?
I am working on an old voice bot I made a couple years ago and it seems like something in Kord is crashing as soon as there's any voice data from the server. I know it was considered experimental, but is it supposed to be able to work currently?
12 Replies
adding that I'm not even doing anything to process the voice streams yet. Just adding the
receiveVoice = true
is enough to crash ithm, i haven't worked with voice much, maybe @Lost or @viztea can help
can you show your setup.
what do you mean by crashing. you have any logs?
I'm not good with android studio so if there's a logcat query that will find anything relevant, I haven't found it. What info from my setup would you like to see?
android studio? is this an android app? not sure what a logcat query is. assuming you have a logging framework setup, you should be getting logs printed to the console.
i am asking to see your code that makes kord "crash". what is crashing btw.
sorry, I forgot this isn't strictly an android library, I was being dumb. I can provide more context now:
- I want to host a discord bot on android
- I am deploying the code from android studio to my phone and running it there. I have the USB debugging logs for everything running in my phone which is difficult to parse out just the ones from this application. (I can put more time into figuring this out if it would help).
- The thing that is crashing is the android application that is running the bot code.
-some code:
this is where I initialize my voice connection from a voice channel. I intend to both send and receive audio. As you can see here the sending is working fine. When I uncomment the receiveVoice line, it works as normal until any other member in the same voice channel as the bot makes any sound, at which point the android application exits for reasons I don't know yet, see above.
fair enough. logs would be helpful, but im not sure if voice has ever been tested on android. i dont have the time at the moment to look into it, but i suppose there could be something with initializing the incoming socket due to whatever android limitations there are. just a guess rn
I know for a fact that it used to work. I made a prototype of this bot a year or so ago. So it's possible that something changed with the discord API but it isn't (or wasn't) a fundamental incompatibility.
ill try to look into it later. gotta fly
yeah I'll try to get better logs and see if I can present something
I may have been too hasty. It may actually be a problem with how I'm handling the incoming streams:
this runs in a separate coroutine. does that look right? is
.collect
a problem?
Okay i was going in completely the wrong direction. As far as I can tell Kord works beautifully for my use case. The cause was actually a crappy Opus codec. Switching to Concentus appears to have fixed the problem. Sorry for wasting your time.
actually maybe i was hasty:
this is on connecting to the voice channel and receiving the first frames. it doesnt appear to be crashing in my code
so I do think Kord has something to do with it
from my limited understanding of the code it looks like something in the early packet processing where it's decrypting. no idea why. the packets do look legit so I imagine it's something involved in the codec
an update: it only seems to happen in one server (guild whatever). I've tried it in a few others and no issue. Seemed to reproduce reliablydiscord did an update to voice that deprecates the encryption kord (and most other libs) used. shouldn’t be out until november or something but i wouldn’t be surprised if it’s something to do w that since it’s discord and it’s on the undocumented receiving end. kord will need to be updated according to the new docs and maybe your issue will be resolved along side it as new encryption methods will be implemented. haven’t looked at the stackstrace tho, could be sum else; js started uni. little time on my pc :pained_smile:
thanks for the heads up! good luck tracking their useless undocumented APIs