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

**URL:** <https://discourse.processing.org/t/loss-of-sound-audio-when-using-videoexport-hamoid-import/23306>\
**Category:** Libraries\
**Created:** [August 17, 2020, 10:06am UTC](https://discourse.processing.org/t/loss-of-sound-audio-when-using-videoexport-hamoid-import/23306 "2020-08-17T10:06:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jesspayne](https://avatars.discourse-cdn.com/v4/letter/j/f07891/32.png) [@jesspayne](https://discourse.processing.org/u/jesspayne)\
**Post date:** [August 17, 2020, 10:06am UTC](https://discourse.processing.org/t/loss-of-sound-audio-when-using-videoexport-hamoid-import/23306/1 "2020-08-17T10:06:49Z")

</div>

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

```auto
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();
}

```

---

<div class="post-metadata">

**Author:** ![jesspayne](https://avatars.discourse-cdn.com/v4/letter/j/f07891/32.png) [@jesspayne](https://discourse.processing.org/u/jesspayne)\
**Post date:** [August 22, 2020, 12:53pm UTC](https://discourse.processing.org/t/loss-of-sound-audio-when-using-videoexport-hamoid-import/23306/2 "2020-08-22T12:53:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![vrtx](https://avatars.discourse-cdn.com/v4/letter/v/e99b99/32.png) [@vrtx](https://discourse.processing.org/u/vrtx)\
**Post date:** [November 19, 2022, 6:35pm UTC](https://discourse.processing.org/t/loss-of-sound-audio-when-using-videoexport-hamoid-import/23306/3 "2022-11-19T18:35:35Z")

</div>

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