Turning on (& off) a webcam reacting to sound
in
Core Library Questions
•
5 months ago
Hello guys,
I am trying to build a sketch where a webcam can be triggered on by using the audio: If the webcam records a audio volume of 'x' the webcam turns on. When it reaches this level again it will go off.
I've already made such a sketch in Max MSP but I want to figure out how to make it in Processing, never worked with the program before so I am a complete stranger.
The code i've found was one which turned a webcam off after a mouseclick;
- import processing.video.*;
- Capture cam;
- void setup() {
- size(640, 480);
- cam = new Capture(this);
- cam.start();
- }
- void draw() {
- if (cam.available()) {
- // Reads the new frame
- cam.read();
- }
- image(cam, 0, 0);
- }
- void mousePressed() {
- cam.stop();
- }
1