samuellapointe / ProcessingCubes

151 stars 62 forks source link

Soundcard input #2

Open bartburkhardt opened 7 years ago

bartburkhardt commented 7 years ago

Hi, do you know how to use it with the sound coming from playing sound on the computer?

samuellapointe commented 7 years ago

I don't know how, but I use the minim library to process sound, you could check the documentation about it: http://code.compartmental.net/tools/minim/

JulesTopart commented 6 years ago

Try that

import ddf.minim.*;

Minim minim;
AudioPlayer jingle;
AudioInput input;
FFT fft;
int[][] colo=new int[300][3];
//AudioIn in;

void setup()
{
  size(480, 320);
  noCursor();

  minim = new Minim(this);

  input = minim.getLineIn(Minim.STEREO, 2048);
  fft = new FFT(input.bufferSize(), input.sampleRate());

}

void draw()
{
  background(0);
  stroke(255);

  fft.forward(input.mix);
  for(int i = 0; i < fft.specSize(); i++)
  {
    fill(i % 250);
    ellipse(i, 200, 7, fft.getBand(i)*20);
  }

  // keep us informed about the window being used
 // text("The window being used is: " + windowName, 5, 20);
}