How to make a sound transition out of videos playing

BAKBAK
edited December 2015 in Kinect

Hello all ! I'am currently working on a video installation out of processing, kinect and madmapper (with python). I would need some help concerning the sound of my videos which is a problem for me... I've a feedback transition with my two videos playing and I would like to figure it out how to make the same "switch" with the sound of the two videos which is now, playing in the same time. :)

Best,

Brice

import codeanticode.syphon.*; PGraphics canvas; SyphonServer server;

import SimpleOpenNI.*; import java.awt.Color; import java.util.Iterator; import processing.video.*;

SingleUserKinect kinect; Movie movie2, movie3 ; PVector userPosRealWorld = new PVector(); // 3d user position float comZ; // Center of Mass X int teSpelenFilmpje; boolean USE_KINECT = true;

void setup() {

// size of the window //size(400,400);// use size "(displayWidth, displayHeight)" for fullscreen
size(displayWidth, displayHeight, P3D); canvas = createGraphics(displayWidth, displayHeight, P3D); // Create syhpon server to send frames out. server = new SyphonServer(this, "Processing Syphon");

movie3 = new Movie(this, "Sequence 05.mp4"); movie3.loop(); movie2 = new Movie(this, "Sequence 06.mp4"); movie2.loop();

// user SingleUserKinect for tracking. if (USE_KINECT) { kinect = new SingleUserKinect(this); } }

// draw is repeatedly executed, as fast as possible, or according to frameRate setting void draw() { canvas.beginDraw(); canvas.background(0); // draw a black background

if (USE_KINECT) { kinect.update(); }

if (USE_KINECT) {
if (kinect.trackedUserId != 0) { kinect.getCoM(userPosRealWorld);
comZ = userPosRealWorld.z; } if (kinect.trackedUserId == 0) { comZ = -1; } }

float fadewaarde = map(comZ,2000,2500,0,255); if(comZ<2000) fadewaarde =0; if(comZ>2500) fadewaarde =255;

canvas.tint(255, 255-fadewaarde); canvas.image(movie3, 0, 0, width, height); canvas.tint(255, fadewaarde); canvas.image(movie2, 0, 0, width, height);

canvas.endDraw(); image(canvas, 0, 0); server.sendImage(canvas);

}

void movieEvent(Movie m) { m.read(); }

// ----------------------------------------------------------------- // SimpleOpenNI user events // ----------------------------------------------------------------- // onNewUser is triggered when the kinect registers a new user void onNewUser(SimpleOpenNI curContext, int userId) { // let our SingleUserKinect Class take care of this kinect.registerNewUser(curContext, userId); }

// onLostUser is triggered when the kinect deregisters a user void onLostUser(SimpleOpenNI curContext, int userId) { // let our SingleUserKinect Class take care of this kinect.deRegisterUser(curContext, userId);

}

Answers

Sign In or Register to comment.