(SOLVED)(Minim/Beads/Sound) How can I play back the LineIn signal (LineIn to LineOut)

edited December 6 in Library Questions

I wrote a music visualization which so far worked using the Minim library playing back mp3 files. Now I tried modifying it so that it would visualize an audio signal in real time. That way, I ran into a latency problem - the visuals are slightly out of sync with the sound (the problem gets less pronounced with buffer sizes as small as 128bits, however still very noticeable.)

Can I use an audio source other than my PC, connect it via LineIn to the processing sketch and play it back from there, so that the visualization and the playback have the same delay?

I tried achieving this using Beads, this solution using Minim as well as its LiveInput class, but had issues with very glitchy audio playback in all cases.

The processing.sound library seems to handle that better, this bit of code seems to do exactly what I want:

import processing.sound.*;

AudioIn input;

void setup() {
input = new AudioIn(this, 0); input.play(); }

void draw() { background(0); }

However, I have experienced it to be very prone to crashing on Windows as soon as the code becomes slightly more complex than that (Target VM fails to initialize, reproducable with some of the included examples, the one most closely related to what I am trying to achieve would be FFTSpectrum), and it does not seem to be in active development anymore.

Is there any way to accomplish this only using Minim or is there a way to combine both libraries - using minim for the analysis and processing.sound for the playback?

Answers

Sign In or Register to comment.