Tuesday, May 7, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1099  / 3 Years ago, tue, october 26, 2021, 9:04:39

I have a created a music visualisation using Processing. I now want to convert that to a video, and the least obtrusive way I could think of is to record a screencast.



I figured exporting Processing to video including audio, from within Processing itself, on ubuntu seemed an unsolved issue. Very hard and also could cause timing sync issues (since the music keeps running while images are captured). So move on to the screencast method.



Dead-easy, I figured. But I was wrong. First hurdle was to find a way to record the sound from the audio (and not the mic).



I did find a tutorial for that here.



In short: use gtk-recordmydesktop and pulse audio.
Exactly:




  • start PulseAudio

  • start gtk-recordmydesktop, and set input from DEFAULT to pulse

  • start recording

  • see the Recording tab in PulseAudio, and selected Internal Audio (or Monitor)



This works if I record from e.g. my webbrowser playing a youtube movie. I see that appear in the PlayBack tab, and can then easily record it. But not for Processing. Processing is written in java. Processing does not use ALSA but uses the hardware devices directly to create the sounds. When the sound is playing, it does not appear in the Pulse Audio mixer.



How can I record the audio now?


More From » java

 Answers
0

I have found that java does not use ALSA but addresses the audio devices directly. Effectively rendering Pulse Audio useless, and thus disabling me to loop the audio back to input for recording. This seemed very hard to circumvent. Further reading learned that this could be related to the JDK in use. So how to circumvent this?



Processing is using java. But when java is run in the browser, it does use ALSA. Somehow, the browser-container handles that correctly for you.



So the easy solution: export your processing sketch to an applet, play the applet in your browser, and record! :)



I hope this can help someone else as well.


[#39717] Thursday, October 28, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
horicgly

Total Points: 36
Total Questions: 126
Total Answers: 104

Location: Iceland
Member since Thu, Dec 1, 2022
1 Year ago
;