I want turn the led off only when the input is low for a prolonged period of time and not when there are ups and downs in sound signal
It's very related to the debounce algorithm (used for debouncing switches/keys), but consider a button 'bounce' as a cry. The time is much longer (seconds, to even minutes).

See here the debounce explanation:

https://www.arduino.cc/en/tutorial/debounce


As soon as the baby starts crying, you want the LED to be turned on (almost) immediately, so use a short 'debounce' (or in this case: cry on) time for a rising edge (start crying), something in ms or a second maybe (I assume it is that time critical).
However, for detecting stopping crying, you probably want a much longer time, maybe even a minute (but I leave the exact timing requirement up to you).