This seems reasonable. This is probably easier to program as a
multi-pass algorithm, but that has the problem that Nyquist will want to
copy all the samples into its memory space. If you want to process big
files, it might be best to compute an RMS signal. E.g. if you compute
RMS every 10ms, you will have 441 samples per second rather than 44100
(if that's your sample rate). You can then decide where to make cuts and
run a second pass that edits the sound but does not retain it.
Two-pass effects that share data are pretty new to Audacity, but work
with the latest version (you might have to compile your own from sources).
There's a built-in function to compute RMS from a signal, and another
function that can convert that to an array you run algorithms over. You
could also do this incrementally in one pass, but I think it would be
tricky for a non-expert.
On 12/8/10 5:25 PM, Ahmad Jagot wrote:
> Hi all,
> I'm dealing with some audio that was recorded over a VoIP link that
> exhibits a unique phenomenon I would like to eliminate. I an a
> newcomer to LISP and am just in need of some help here and there to
> patch things together,
> The phenomenon mentioned is this - things which sound like 'skipping'
> are audible in the recording. Upon visual spectrogram analysis, it is
> revealed that these are not skips in a true sense, but rather 'gaps'.
> In effect, the transmission is cut off in places, but when sound
> begins again, it picks up from where it left off, and no audio data is
> I therefore need to write a plugin which detects these special
> silences and deletes them. I figure the process would go something
> like this:
> 1)Look for silence (ie. audio below a user-specified 'silence
> threshold') - I am guessing I can just copy& paste this part from an
> existing plugin
> 2)Check whether silence is immediately preceded by an differential of
> amplitude higher than [some fixed value] and almost-immediately
> preceded by an amplitude of [some user-specified threshold]
> 3)Check whether the silence is immediately succeeded by a differential
> of amplitude higher than [some value] and almost-immediately succeeded
> by an amplitude of [some user-specified threshold]
> 4)If 3) Is not satisfied then move on to the next silence...
> 4)If both 2) and 3) are satisfied, then delete this segment of silence
> and move on to find the next silence. If not, then move on to the
> next silence.
> How sound is my process, above? And how would I go about implementing
> the code which detects how sharply 'sound' becomes 'silence', allowing
> these 'skips' to be discarded.
> Thanks in advance,
> This SF Dev2Dev email is sponsored by:
> WikiLeaks The End of the Free Internet
> Audacity-nyquist mailing list