Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

Playing movie clips after after another at volume 0, there's sound for a split second every clip

$
0
0

Hi,

i'm struggling to completely mute movie clips. Here's the code (I guess the problem lies in the new_movie() function at the bottom):

import processing.video.*;

Movie movie;
String[] filenames;

void setup() {
  size(640, 480);
  java.io.File folder = new java.io.File(dataPath("C:\\Users\\Marin\\Downloads\\clips"));
  filenames = folder.list();
  frameRate(30);
  new_movie();
}

void draw() {
  if (movie.time() >= movie.duration()) {
    new_movie();
  }

  if (movie.available()) {
    movie.read();
    background(0);
    image(movie, 0, 0);
  }
}

void new_movie() {
  int newmovid = int(random(filenames.length));
  movie = new Movie(this, "C:\\Users\\Marin\\Downloads\\clips\\" + filenames[newmovid]);
  movie.play();
  movie.volume(0);
}

Setting the volume before movie.play() has no effect (the whole clip plays at full volume) and removing the soundtrack from 1000+ mp4 files doesn't sound very optimal.

What should I do?

Thanks!


Viewing all articles
Browse latest Browse all 2896

Trending Articles