paura icon indicating copy to clipboard operation
paura copied to clipboard

how does this silence detection method work (is there a documented example)?

Open pepperpepperpepper opened this issue 6 years ago • 0 comments

I like this project a lot. I've heard of silence detection using RMS what is this method?

Activity Detection:

               #what's energy100? sum of the squares * 100 divided by the sample rate? 
               energy100 = (100*numpy.sum(midTermBuffer * midTermBuffer) 
                    / (midTermBuffer.shape[0] * 32000 * 32000))     
                if count < 10:           #sample the first few seconds of silence
                    energy100_buffer_zero.append(energy100)                    
                    mean_energy100_zero = numpy.mean(numpy.array(energy100_buffer_zero))
                else:
                    mean_energy100_zero = numpy.mean(numpy.array(energy100_buffer_zero))
                    if (energy100 < 1.2 * mean_energy100_zero): #new silence

My main question: why this

(100*numpy.sum(midTermBuffer * midTermBuffer) / (midTermBuffer.shape[0] * 32000 * 32000))

and not RMS?

Any help with this would be much appreciated!! (is it in your book??)

pepperpepperpepper avatar Jun 21 '18 03:06 pepperpepperpepper