Hey @ssi_karim !
I seem to have solved it. I used the default sound library for this.
int FPS = 25;
float startPos = 0.0;
float endPos = 10.0; //for 10 seconds of audio
float a = startPos;
//SoundFile, Amplitude, BeatDetector etc variable declaration
void setup() {
//setup code here
frameRate(FPS);
}
void draw() {
song.jump(a);
amp = amplitude.analyze();
beat = beatDetector.isBeat();
// use the values of amp and beat to create visuals
saveFrame("....");
a += 1.0/FPS;
if(a >= endPos) exit();
}