Loss of sound/audio when using VideoExport (hamoid import)

Hi all,

I’m trying to export my sketch using the VideoExport function (Hamoid import) but am losing sound on playback. I’ve copied my code below - am I missing something?

Thanks in advance,
Jess

import com.hamoid.*;
import ddf.minim.*;

Minim minim;
AudioPlayer song;

int spacing = 16; // space between lines in pixels
int border = spacing*2; // top, left, right, bottom border
int amplification = 3; // frequency amplification factor
int y = spacing;
float ySteps; // number of lines in y direction

VideoExport videoExport;

void setup() {
  size(800, 800);
  background(255);
  strokeWeight(1);
  stroke(0);
  noFill();
  minim = new Minim(this);
  song = minim.loadFile("Julia.mp3");
  song.play();
  videoExport = new VideoExport(this, "myVideo.mp4");
  videoExport.setFrameRate(30);
  videoExport.startMovie();
}
void draw() {
  int screenSize = int((width-2*border)*(height-1.5*border)/spacing);
  int x = int(map(song.position(), 0, song.length(), 0, screenSize));
  ySteps = x/(width-3*border); // calculate amount of lines
  x -= (width -3*border)*ySteps; // set new x position for each line
  float frequency = song.mix.get(int(x))*spacing*amplification;
  rect (x+border, y*ySteps+border, frequency*50, frequency*50);
  videoExport.saveFrame();
}
void stop() {
  videoExport.endMovie();
  song.close();
  minim.stop();
  super.stop();
}

If anyone is able to help review my code to understand why I have no sound on video replay I’d really appreciate it! Many thanks, Jess

Hi there…
i tested your code, In my processing 4.01 only comes up the sound mp3.
Maybe this library is too old…

1 Like