I'm completely new to this, so apologies if it's in the wrong place.
I'm trying to display an image based on an audio input ie < than
If a certain threshold is reached I want one image to display. If the sound levels drop I want the image to disappear.
I don't know how to write the function which declares when to load the image? Or to be honest where to put it in the sketch
Thanks, I appreciate your help.
Here is what I have so far using GetLineIn and loadimage
import ddf.minim.*;
Minim minim;
AudioInput in;
PImage a; // Declare variable "a" of type PImage
void setup()
{
size(512, 200, P2D);
minim = new Minim(this);
minim.debugOn();
// get a line in from Minim, default bit depth is 16
in = minim.getLineIn(Minim.STEREO, 512);
size(200, 200);
// The file "jelly.jpg" must be in the data folder
// of the current sketch to load successfully
a = loadImage("jelly.jpg"); // Load the image into the program
noLoop(); // Makes draw() only run once
}
void draw()
{
// Displays the image at its actual size at point (0,0)
image(a, 0, 0);