How would i go about getting an inputstream from the audio in a voice channel
In JDA 3.0 I'm considering creating an implementation of AudioReceiveHandler that would allow you to retrieve an AudioInputStream. Be on the lookout for that when it comes out.
Is this still a thing? And could someone show me how to build an AudioInputStream with the help of the AudioReceiveHandler?
@AutismSpeaks @Panzer1119
I am working on an InputStream wrapper for Channel objects (including VoiceChannels).
If you want to try that, here: https://github.com/BenjaminUrquhart/CIO
How would an AudioInputStream work? One can only create an AudioInputStream instance when its length (count of sample frames) is already known. This means that you can only store a fixed length of audio in an AudioInputStream, it can't be a real stream as in one that is going to receive new data constantly. It might still be useful to provide AudioInputStream instances though, it would just have to have a specified length and would need a handler that takes these instances. (Think about how some recording software works: they save multiple files of a fixed length. Each AudioInputStream here would represent a file.)
A normal InputStream might be more useful, but I am not familiar with what today's Java voice recognition, real-time processing libraries take as an input.
Most helpful comment
In JDA
3.0I'm considering creating an implementation of AudioReceiveHandler that would allow you to retrieve an AudioInputStream. Be on the lookout for that when it comes out.