How do I get the amplitude from an audio file?

import processing.sound.*;
Amplitude amp;
AudioIn in;
SoundFile file;
float[] amp_values;

void setup()
  file = new SoundFile(this, "audio.mp3");
  in = new AudioIn(this);;

void draw()

So currently this is my code to attempt to get the audio from the audio file but here is the error message:

Jul 26, 2020 2:54:18 PM com.jsyn.devices.javasound.JavaSoundAudioDevice <init>
INFO: JSyn: default output latency set to 80 msec for Windows 10
Could not run the sketch (Target VM failed to initialize).
For more information, read revisions.txt and Help ? Troubleshooting.

I am not too sure why this is happening

Edit: I have the audio.mp3 in the same directory as my project.


There are lots of examples that come with Processing:



I understand that but why is this failing though, I also keep getting a null pointer exception with amp.input(in); Not too sure why this is the case.

You are missing something in your code.

Look at this example:


1 Like