Skip to content

Instantly share code, notes, and snippets.

@jaegonlee
Last active September 10, 2018 07:08
Show Gist options
  • Save jaegonlee/364cedf94e08c99b4d1a8ef50603a279 to your computer and use it in GitHub Desktop.
Save jaegonlee/364cedf94e08c99b4d1a8ef50603a279 to your computer and use it in GitHub Desktop.
processing audio input example
import processing.sound.*;
AudioIn input;
Amplitude loudness;
void setup() {
size(640, 360);
background(255);
input = new AudioIn(this, 0);
input.start();
loudness = new Amplitude(this);
loudness.input(input);
}
void draw() {
float volume = loudness.analyze() * 350;
background(125, 255, 125);
noStroke();
fill(255, 0, 150);
ellipse(width/2, height/2, volume, volume);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment