syncing image manipulation with sound level [minim]

edited November 2013 in Questions about Code

Hello,

A try to use the level of a wave sound as a parameter to a warp an image. I've tried this (simplified) algorithm :

PImage source;
AudioPlayer player;

void setup() {
  source = loadImage("myimage.jpg");
  minim = new Minim(this);
  player = minim.loadFile("mysound.wav");
}

void draw() {
  player.cue(toTheRightPosition);
  player.play();
  PImage destination = warp(source,player.left.level());
  image(destination, 0, 0);
  saveFrame("line-######.png");
}

It does not work very well. So I would like to know if it is possible to get the sound buffer of an AudioPlayer without playing it (I don't need to play the sound, I use virtualDub to create an avi with the sound afterward).

It could look like :

player.cue(toTheRightPosition);
AudioBuffer mybuffer = player.getbuffer();

I hope my question is clear enough... Anybody could help me ?

Regards

Answers

  • edited November 2013

    Hi, I've looked in the src directory of minim. And in the AudioSource.Java Damien wrote :

    // TODO: add a way for the user to pull the audio without having to 
    // have it playback, for people that want to just analyze files.
    

    That is exactly what I need ! Image and sound synchronisation would be very easy that way...

    Regards

Sign In or Register to comment.