Skip to content

Instantly share code, notes, and snippets.

@memish
Created September 30, 2018 17:45
Show Gist options
  • Select an option

  • Save memish/e5fbb07b4866371fd85f01386750d4ad to your computer and use it in GitHub Desktop.

Select an option

Save memish/e5fbb07b4866371fd85f01386750d4ad to your computer and use it in GitHub Desktop.
//Imports needed
import ddf.minim.analysis.*;
import ddf.minim.*;
//object needed to access microphone
AudioInput input;
//works with input to access microphone sound
Minim minim;
//needed analyze the sound
FFT fft;
void setup()
{
size(640, 480);
minim = new Minim(this);
input = minim.getLineIn();
//input will be based on your computers input capabilities
fft = new FFT(input.bufferSize(), input.sampleRate());
}
void draw()
{
background(0);
stroke(255);
fft.forward(input.mix);
println(fft.specSize());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment