Completely cutting silence out of an audio file
Solution 1:
Try this, assuming you can use a sufficiently recent (post 2007, unstable) version of audacity.
Summary of the suggestion, as requested by @slhck:
Obtain a version of Audacity later than version 1.3.3. The stable version of Audacity is from 2006, and does not contain the same functionality as the more recent preview releases.
Open the file you want to remove the whitespace from.
Go to Effect > Truncate Silence.
Set Min silence duration and Max silence duration to the same value, the length of the longest pauses you want to keep, probably at least a few hundred ms.
Set Threshold for silence to the threshold you want for detecting silence. You'll probably have to fiddle a bit with this unless you have somehow blanked the silences completely.
The effect is described here
Solution 2:
I have gaps in my interned steaming recordings due to buffering. I found that they can all be automatically closed by using the Effect > Truncate Silence method. I set the duration to 0.1 seconds for detection with a level of -60db and the output duration to 0. Works perfectly.