Trouble printing AudioInput data with Minim library

edited September 2014 in Library Questions

Hello All, I'm modifying an example code I found online that uses the Minim library to detect sound with AudioInput and draw a line that displays oscillations -- a simple oscilloscope. I want to use a similar method to modify background color with audioinput - I want to map sound from 100hz to 2000hz onto the color spectrum so that as you slide up through a scale, the screen slides through the color spectrum.

Right now I'm simply trying to print the data coming in from audio input in this applet I'm modifying so that I can see the range of numbers coming in. I inserted "println(in)" at the end of the "void draw()" section to print the AudioInput variable, but it just prints this over and over: ddf.minim.AudioInput@416fa1ee

I'm stuck, any suggestions?

Here's the full code I'm working with:

import ddf.minim.*;

Minim minim; AudioInput in; color white;

void setup() { size(512, 200, P2D); white = color(255); colorMode(HSB,100); minim = new Minim(this); minim.debugOn();

// get a line in from Minim, default bit depth is 16 in = minim.getLineIn(Minim.STEREO, 512); background(0); }

void draw() { background(0); // draw the waveforms for(int i = 0; i < in.bufferSize() - 1; i++) { stroke((1+in.left.get(i))50,100,100); line(i, 50 + in.left.get(i)50, i+1, 50 + in.left.get(i+1)50); stroke(white); line(i, 150 + in.right.get(i)50, i+1, 150 + in.right.get(i+1)*50); }

println(in); }

void stop() { // always close Minim audio classes when you are done with them in.close(); minim.stop(); super.stop(); }

Sign In or Register to comment.