lost
lost
KKord
Created by Marc on 4/21/2025 in #help
User audio processing only works after rejoin
see https://github.com/kordlib/kord/pull/1008 for the fix and if/when it is merged.
23 replies
KKord
Created by Marc on 4/21/2025 in #help
User audio processing only works after rejoin
discord sends you a speaking event for every user when you join a channel, and then for any new user that joins later
23 replies
KKord
Created by Marc on 4/21/2025 in #help
User audio processing only works after rejoin
not sure what you mean exactly by first? but i think yesish? assuming you create this collector soon after the #connect call.
23 replies
KKord
Created by Marc on 4/21/2025 in #help
User audio processing only works after rejoin
weird that u had to supply your own event flow. and yeah personally just:
val s2u = mutableMapOf<UInt, Snowflake>()
connection.voiceGateway.on<Speaking> { speaking ->
s2u.putIfAbsent(speaking.ssrc, speaking.userId)
}
val s2u = mutableMapOf<UInt, Snowflake>()
connection.voiceGateway.on<Speaking> { speaking ->
s2u.putIfAbsent(speaking.ssrc, speaking.userId)
}
would probably suffice. thats more or less what kord is doing. and then just use s2u inside your onEach or wherever
23 replies
KKord
Created by Marc on 4/21/2025 in #help
User audio processing only works after rejoin
works for me. the speaking event would inform you of a user's ssrc. it gets sent right when the bot joins, or when a new user joins.
23 replies
KKord
Created by Marc on 4/21/2025 in #help
User audio processing only works after rejoin
you could maintain your own map of ssrc to an actual discord user if you need. just listen to the speaking event from the voice gateway. or if youre fine with the ssrc being your identifier per user, that works fine too
23 replies
KKord
Created by Marc on 4/21/2025 in #help
User audio processing only works after rejoin
kord does the ssrc <-> user mapping but i guess discord changed some stuff to where theres a race condition between when kord begins listening for this mapping notice (speaking event), versus when its actually sent
23 replies
KKord
Created by Marc on 4/21/2025 in #help
User audio processing only works after rejoin
the uint is the ssrc which is unique per user
23 replies
KKord
Created by Marc on 4/21/2025 in #help
User audio processing only works after rejoin
race condition basically
23 replies
KKord
Created by Marc on 4/21/2025 in #help
User audio processing only works after rejoin
yeah i got a test bot running and can repro it
23 replies
KKord
Created by Marc on 4/21/2025 in #help
User audio processing only works after rejoin
@Marc just looked at the code. i imagine it still works. do you have the voice state intent enabled?
23 replies
KKord
Created by Marc on 4/21/2025 in #help
User audio processing only works after rejoin
voice connections send audio packets linked to an ssrc (a unique identifier for each user). whats happening is that a cache which builds the ssrc <-> discord user map has to be populated and isnt known when the bot joins (until, for example, you rejoin and discord lets us know of this new ssrc <-> user mapping). not sure if this is intentional or a bug, its been a few years. if a flow that provides packets mapped to a unique ssrc will suffice, use the incomingAudioFrames flow. in the mean time ill see what we could to build this map instantly, since obviously the discord client can do it too.
23 replies
KKord
Created by Peffern on 9/2/2024 in #help
Does receiveVoice still work?
discord 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:
20 replies
KKord
Created by Peffern on 9/2/2024 in #help
Does receiveVoice still work?
ill try to look into it later. gotta fly
20 replies
KKord
Created by Peffern on 9/2/2024 in #help
Does receiveVoice still work?
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
20 replies
KKord
Created by Peffern on 9/2/2024 in #help
Does receiveVoice still work?
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.
20 replies
KKord
Created by Peffern on 9/2/2024 in #help
Does receiveVoice still work?
can you show your setup. what do you mean by crashing. you have any logs?
20 replies