Implement pitch detector class · Issue #58 · processing/processing-sound (original) (raw)

Is it possible to get various information about an audio file such as current tempo, loudness, key/pitch etc?

I am going through the sound library and I am finding some difficulties finding how to do this.

image

For example if I want to get the loudness (I believe this is the amplitude) here is the sample code:

import processing.sound.*;
Amplitude amp;
AudioIn in;

void setup() {
  size(640, 360);
  background(255);
    
  // Create an Input stream which is routed into the Amplitude analyzer
  amp = new Amplitude(this);
  in = new AudioIn(this, 0);
  in.start();
  amp.input(in);
}      

void draw() {
  println(amp.analyze());
}

Where is the the sound coming in from?