Sound / Silence in wav file
I'm looking for a utility / code that could detect and tell me if my 1 minute wav file contains sound or not? In another way, if it could detect the duration of silence (if exists) at any position in the wav file, would serve the server as well.
Does SOX support any command for this? I tried with Java but didn't find anything in JMF.
thanks
Vivec
a source to share
SoX has the ability to trim silence, but I'm not sure if this helps you:
silence [-l] over periods [duration threshold [d |%] [duration threshold below periods [d |%]]
Removes silence from the beginning, middle, or end of the sound. "Silence" is determined by a given threshold.
a source to share
You can write your wavefile processor easily, this is a simple header and then just plain data. You can easily find the sample size, 8 or 16 bits, and then read the sample file by sample if you find a sequence of samples with a value of 0, after which you have silence. Measure the number of samples to 0 and use the sample rate (also in the header) to calculate the duration.
a source to share