Coding that can recognize sound for a certain period of time

Is there any coding that recognizes a sound for a certain period of time, distinguishes the recognized sound through a personalaudioclassifier, and then vibrates when a specific sound is recognized?
I've used a clock to code for recognizing sounds for a certain period of time, but I'm not sure

See SoundAnalysis here

1 Like

Thank you for your reply. Could you please tell me how to code it to recognize sound for a certain period of time? now this is the biggest problem