We are about to switch to a new forum software. Until then we have removed the registration on this forum.
import ddf.minim.*;
Minim minim;
AudioInput in;
AudioRecorder recorder;
void setup() {
size(800, 600); // size always goes first!
if (frame != null) {
frame.setResizable(true);
}
minim = new Minim(this);
in = minim.getLineIn();
recorder = minim.createRecorder(in, "myrecording.wav", true);
textFont(createFont("Arial", 12));
}
void draw()
{
background(0);
stroke(255);
for(int i = 0; i < in.bufferSize() - 1; i++)
{
line(i, 150 + in.left.get(i)*50, i+1, 150 + in.left.get(i+1)*50);
line(200 + in.left.get(i)*50, i, 200 + in.left.get(i+1)*50, i+1);
line(i, 450 + in.right.get(i)*50, i+1, 450 + in.right.get(i+1)*50);
line(600 + in.right.get(i)*50, i, 600 + in.right.get(i+1)*50, i+1);
}
if ( recorder.isRecording() )
{
text("Currently recording...", 5, 15);
}
else
{
text("Not recording.", 5, 15);
}
}
void keyReleased()
{
if ( key == 'r' )
{
if ( recorder.isRecording() )
{
recorder.endRecord();
}
else
{
recorder.beginRecord();
}
}
if ( key == 's' )
{
recorder.save();
println("Done saving.");
}
}
how can i make the background color change with the sound...?
Answers
Try something like this: