Hello guys, I'm currently trying to implement jAudioRecord2 in my project, however, when starting the audio recording, the window and some components start to freeze, and only return to normal when the audio recording ends...
Is it possible to fix this lag with thread? How would I do it?
Recording audio is a resource intensive process, it is not often that you are going to be moving a window while recording. That said, jAudioRecord implements threading, so you could try that.
Yes, it would be possible. It would require working out the best way to implement it, which would probably be as a compiled Java library so that it can be used while debugging the rest of the app. and would require two additional classes, one for Capture to file and one for Capture Raw.
Then it would complicate the existing classes as the structure required for the threaded class is different, and won't work the same with the resumeable subs that the current classes were designed for. They would be mostly the same.
If you want to try a threaded approach, try the attached, it supports threaded and non threaded recording. Bear in mind that the demo is just that, and you can take the modules you want for your project and implement one or more methods.
The threaded classes cannot be used in debug mode, that would require a bigger rewrite of the demo.