How to modify the program? Sound detection and face tracking

Thank you very much for the hints. I tested this solution, but unfortunately, it doesn’t work as it should.

I looked for information and found a clue. Starting an oscillator on a user gesture will enable audio in browsers that have a strict autoplay policy. That’s i why this code snippet is used:

function playOscillator () {
   osc.start ();
   playing = true;
}

But this is exactly what I want to avoid – my program will ultimately run offline on a local device and I don’t need it. So.

userStartAudio ();

Probably this is what will help solve the problem. The oscillator will start when it detects user movement.

But here comes the beginner’s problem again. I still don’t know how to implement this in the code :frowning:

1 Like