You... check for the silence(!)... and then *gasp* do the stuff.
Seriously, if you want usefull answers you should provide all the details you can get.
Ah well... I tell you this... there are two kinds of "silence". Digital absolute - there is nothing - silence and sound from let's say line-in or a mic and there is no real noise. The former is easy to ckeck and the latter needs to be some kind of fuzzy conditions. So instead of checking for a zero volume you check for let's say a volume wich is lower than 5% (or any other treshold).
Whenever the one or the other type occurs you set a marker and if it lasts for a specific timespan you found a pause/silence.