-
-
Notifications
You must be signed in to change notification settings - Fork 735
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
Provide access to decrypted AudioPackets, regardless of sequence number #418
Comments
It would be really useful, but recording people without them knowing in a (group)voice chat is illegal in many countries. It should be restricted to the currently logged in user's voice, if possible. (Not sure whether it is) |
People can and will always abuse features. Restricting recording to yourself (which is implementation wise something entirely different from recording others btw) just because someone might use on other people without their knowledge is really bad imo. |
I thought so
True, but we are allowing them to do so by adding this. If I am speaking with someone and I want to record only myself, I can use a mic/recording software. A bot will allow abusing and nothing else. |
JDA already supports receiving the audio of users when they speak. I don't understand how this discussion is relevant to the thread. |
It's relevant to the suggestion - whether or not it makes sense. |
The suggestion has nothing to do with the fact that you can already implement such a functionality with the current state of JDA. It is requested to give access to unhandled frames to users. |
If it's already a thing, the whole issue can be closed. It's not my reply, but the issue itself that's redundant. |
No you don't even understand what is requested, stop arguing about something that is completely irrelevant to this thread please. |
@mentlerd I don't see the use case. Additionally, it really isn't the client's responsibility to decode and ensure packet ordering. That is the entire point of a library. It abstracts that system so that the client doesn't have to care about it. Also, to properly decode audio packets, we have to keep a semblance of order, otherwise OPUS's decoding algorithms get mad and can produce jarring audio artifacts If you want UserSpecific audio recording (e.g, not the combined audio of all users), JDA already provides that. |
My use case would be a "rolling window" voice recorder bot, that would allow to capture the last X minutes of conversation, with separate channels for each user. Since this application is not realtime at all, I could just save the packets in the order I receive them onto the disk, then later reassemble each user's complete stream (accounting for packet order, and discord not sending audio packets for continuous silence), decode OPUS and encode the audio to a different format. This approach requires other metadata to be saved to the disk, but as you have mentioned before, this application is out of the scope of the library. I am only asking for an API to access raw AudioPackets, and possibly disable OPUS decoding to save on performance. |
Discord sends the AudioPackets in the OPUS format so JDA wont or cant change that (i dunno i'm not staff) , and you can access the packets via AudioReceiveHandler using the methods handleUserAudio or handleCombinedAudio. Here is an example
I hope that helps you. PS: I recommend Audacity for converting the pcm into the format of your choice |
I appreciate your attempt to help, but I am very well aware of the current interface of the audio system. This is not a support/help ticket, and I have done my homework on the subject. |
I appreciate the PR and I will review it after Could you possibly elaborate as to why you cant capture the PCM output via UserAudio and save that to the disk? |
@MinnDevelopment has further elaborated on your use-case in a way that I missed. You basically need what the AudioSendHandler has, a flag to determine I will review your PR, but most likely AudioReceiveHandler will have a method in which you can decide whether to use opus decoding or not. |
I do have plans for this, namely a boolean hook in AudioReceiveHandler to control decoding, similar to the |
I'm actually in need of the same feature. It seems like @MinnDevelopment has already started working on it in |
There are currently no plans to work on voice receive at all due to #904 |
For applications that wish to do per-user voice recording an API like this would be really useful.
The responsibility of having to reassemble the audio stream from out-of-order packets should be placed on the consumers of the interface.
The text was updated successfully, but these errors were encountered: