[CM] [Snd] Searching conditionally for starts and ends of phrases
Wed, 7 Mar 2007 16:19:33 +0200
I'm a starting user trying to customize Snd to edit spoken word audio.
I'd like to use Snd to find starts and ends of utterances. I can
calculate rms values at cursor, but I can't figure out how to
integrate this to the search.
My code is listed below. I suppose I've misunderstood something about
make-moving-average, but I don't know what (I also haven't found out
how to debug my code, so that's a problem too.
Any help appreciated!
(define (rms position)
(let* ( (data
(channel->vct (max (- position 1024) 0) 1024)
(sqrt (/ (dot-product data data) len))
(let* ( (search-for-sound
(if (< (rms (cursor)) .05) 1 0 )
(let ((sum-of-squares (moving-average buffer (* y y)))
(if (= search-for-sound 1)
(> sum-of-squares highthreshold)
(< sum-of-squares lowthreshold)