This isn't a question. Hopefully it's an answer for some of you!
People commonly ask how to synchronize audio and video output from a Processing sketch. I've seen some of the hacks to make this work using Minim. If you use Beads to play your audio, then the solution is much simpler. I'd like to share my solution here.
I've tried many, many, many solutions to this problem, including screen capture software, and even hardware devices. If you want to capture video in a resolution that is higher than a standard DVD, then this is the best solution, as far as I know.
It's also easy and free, as long as you're willing to use Beads rather than Minim (Beads is superior in many ways anyway imho).
Without further ado, see the code in action and get the source from here: http://computermusicblog.com/blog/2012/01/07/how-to-render-synchronous-audio-and-video-in-processing-using-beads/
The main caveat to this code is that it does slow down sketch execution. Screen capture utilities cause the same problem, AND they often cause glitches in the audio stream. One benefit to this solution is that even if glitches occur in your audio stream due to the rendering process, they won't be captured in the rendered output. In other words, the output will be glitch-free, even if it doesn't sound that way when rendering.
Also, I should note that I have to significantly lower my sketch resolution to get satisfactory results. On a simple sketch, I might be able to render at 1280x720, but on most sketches, I have to render at 800x600 at only 12 frames per second. This is a significant trade-off, but the frame rate is consistent and the audio comes out glitch free. Again, this can't be said about screen-capture utilities, and the rendered output is satisfactory for sharing online, or even on a DVD.
So ... I hope this helps some of you!
People commonly ask how to synchronize audio and video output from a Processing sketch. I've seen some of the hacks to make this work using Minim. If you use Beads to play your audio, then the solution is much simpler. I'd like to share my solution here.
I've tried many, many, many solutions to this problem, including screen capture software, and even hardware devices. If you want to capture video in a resolution that is higher than a standard DVD, then this is the best solution, as far as I know.
It's also easy and free, as long as you're willing to use Beads rather than Minim (Beads is superior in many ways anyway imho).
Without further ado, see the code in action and get the source from here: http://computermusicblog.com/blog/2012/01/07/how-to-render-synchronous-audio-and-video-in-processing-using-beads/
The main caveat to this code is that it does slow down sketch execution. Screen capture utilities cause the same problem, AND they often cause glitches in the audio stream. One benefit to this solution is that even if glitches occur in your audio stream due to the rendering process, they won't be captured in the rendered output. In other words, the output will be glitch-free, even if it doesn't sound that way when rendering.
Also, I should note that I have to significantly lower my sketch resolution to get satisfactory results. On a simple sketch, I might be able to render at 1280x720, but on most sketches, I have to render at 800x600 at only 12 frames per second. This is a significant trade-off, but the frame rate is consistent and the audio comes out glitch free. Again, this can't be said about screen-capture utilities, and the rendered output is satisfactory for sharing online, or even on a DVD.
So ... I hope this helps some of you!