Recognizing loud sounds.

Yes D1, R2 and C2 together form an envelope detector.