OV7670 Image capture Via. Mic module

Ok the idea is to take a picture with OV7670, and use the mic module as a trigger system.

The code is down below. I want to do some kind of coding like this:

void loop()
{
if (digitalRead(SoundSensorPin) == HIGH)
{
TakePicture();
}
}

but I dont know where to put it in the long OV7670 code. There is a lot of things in this code and it is a bit confusing.

Ty.

OV7670_code.ino (23.2 KB)