Finding silent portions of Sound Files

I’ve created a sound file (mp3 in this instance) that contains words and phrases separated by a momentary pause. I’ve then used GarageBand to manually note where the pauses occur and I enter an array into my program with the starting/stopping points for each entry so that I can randomly play any of the words or phrases.

Is there a way to 1) programmatically identify the “blank” areas using XOJO, Javascript or some other tool so that I wouldn’t have to do this manually and then 2) possibly reducing the file size by tightening up the “blank” space? I can see the blank areas on the GarageBand timeline, but have no idea what to look for if I tried to read the file and process it.

Check classes like SoundFileMBS to read samples from audio files.

Once you have samples, divide them into small segments, e.g. 0.1 seconds and calculate the maximum absolute values for each. Silent items should be close to 0.