Selecting and deleting audio between labels.

I am editing recorded speech. I want to cut out silences longer than a specified limit. I used the “Analyze>Sound Finder” tool to find the audio in question. IT can find up to 20 to 40 gaps in a recording, so manually selecting and deleting the audio in question is not efficient at this scale.

IN the picture I have uploaded, I have manually selected the audio I would like to delete. YOu can see labels on either side. Is there a way to select all unlabelled audio and delete it automatically?

  1. Ctrl+A (select All)
  2. “Edit > Labeled Audio > Copy”
  3. Double click on audio track to select it
  4. Ctrl+V (Paste contents of the clipboard)
  5. “Effect > Truncate Silence”

For Truncate Silence set the controls to:

  • 100 millisecond (must be less than the smallest gap that you need to remove)
  • 1 millisecond (gaps will be truncates to 1 millisecond)
  • 1 (effectively disabling the “compression” stage)
  • -75 dB (it would be better to use -80 dB, but that does not work due to a bug)

Thank you so much! it works perfectly :smiley: :smiley:

The “silences” between the sounds look quite clean/low level. I’m a bit surprised the Labeled Audio and copy/paste steps would be completely necessary (and to be pedantic, you only need to select the label track to use the Labeled Audio commands).


It may not be, but if Glubbdrubb has the labels then he/she may as well use them.

You’re correct that with “clean” gaps, the “Truncate Silence” effect could be used directly on the unlabelled audio, but the user could not be certain about what is going to be removed until processing is complete. By labelling first, the user can check that the labels are correct and adjust if necessary before running Truncate Silence.

The ability to label “silent” regions (region labels in “Silence Finder”) would make the task much easier.

On the other hand, this is a case where the ability to “invert labels” would be useful (replace existing labels with new labels in the non-labelled regions).

Quite so, but “Ctrl+A” is quick and convenient in this specific case.

Enhancing Sound Finder and Silence Finder has been discussed at great length on the Forum without complete agreement as to whether we need one “Finder” or two or how many features should be included.

I still tend to the view that we should retain a simple non-region Silence Finder (given the large number of rank beginners we have who want to mark tracks in tapes and records) but have a bells and whistles Sound Finder with an option to find silent regions.

But it would be good to make some progress on enhancing one or the other or combining them (if essential).


I agree.
I’m confident that I can do “improvement”, but with such diversity in use cases I doubt that I can do “perfection” :wink:

I recall tha Steve was working, a while back, on a plug-in specifically for this called Album Track Marker. I remember bench-testing it for him and providing sample files. Whatever happened to that?


I didn’t notice this earlier, but this method is removing/not including audio in the first and last labels. It dissapears when I paste the audio back over the track. For some reason, the first and last tracks are not being selected when I use the “Copy Labelled Audio” function.

I tried this in 2.0.6-alpha on Windows 8.

  1. Generate > DTMF Tones, 1 minute
  2. Effect > Fade In so we can distinguish each section of the DTMF
  3. Analyze > Sound Finder, default settings except -60 dB threshold, which produces eight labels, one for each section of DTMF
  4. Click below the name of the Label Track, then Edit > Labeled Audio > Copy
  5. Tracks > Add New > Audio Track
  6. CTRL + V to paste in the new track
  7. Comparing the paste with the original audio track, the first section of DTMF is not pasted.

If I use Edit > Labeled Audio > Cut, the first section of DTMF is not cut.

If before step 4 I select all then Time Shift the audio and label tracks after zero, Edit > Labeled Audio > Copy then paste will paste all eight sections of DTMF.

So something is not correct but I cannot reproduce the missing last label. Do you have only one audio track and label track? Are you selecting the entire label track by clicking below the label name?


It seems the workaround is to carefully select over the entirety of all labels using the mouse.


Confirmed. That’s a bug.

Try replacing “SoundFinder.ny” (in the plug-ins folder) with this version:
SoundFinder.ny (6.49 KB)

Thanks. I agree that fixes it. The start of the first label was behind zero. So clicking the label track did not select all of the first label, and so that label was disregarded by the Labeled Audio commands.

With the committed Sound Finder:

<labeltrack name="BZ" numlabels="8" height="73" minimized="0" isSelected="0">
		<label t="-0.02000000" t1="4.56000000" title="1"/>
		<label t="7.98000000" t1="12.64000000" title="2"/>
		<label t="16.06000000" t1="20.72000000" title="3"/>
		<label t="24.14000000" t1="28.80000000" title="4"/>
		<label t="32.22000000" t1="36.88000000" title="5"/>
		<label t="40.30000000" t1="44.96000000" title="6"/>
		<label t="48.38000000" t1="53.04000000" title="7"/>
		<label t="56.46000000" t1="61.01000000" title="8"/>

With the “fixed” version

<labeltrack name="Label Track" numlabels="8" height="73" minimized="0" isSelected="1">
		<label t="0.00000000" t1="4.56000000" title="1"/>
		<label t="7.98000000" t1="12.64000000" title="2"/>
		<label t="16.06000000" t1="20.72000000" title="3"/>
		<label t="24.14000000" t1="28.80000000" title="4"/>
		<label t="32.22000000" t1="36.88000000" title="5"/>
		<label t="40.30000000" t1="44.96000000" title="6"/>
		<label t="48.38000000" t1="53.04000000" title="7"/>
		<label t="56.46000000" t1="61.01000000" title="8"/>


Strictly speaking, it’s a “feature”, not a “bug”.

Sound Finder is designed to place the start of labels before the start of each detected sound.
There is no special treatment of the first label, so if the selection starts with a sound, then the first label will begin before the start of the selection.

In Gale’s steps, Step 4 (Click below the name of the Label Track, then Edit > Labeled Audio > Copy) selects from time=0.0 to the end of the final label. Because the first label is not entirely within the selection (it starts before time=0) it is not included when copying the labelled audio.
This is consistent with the description of the Labeled Audio commands in the manual:

The [b]Edit > Labeled Audio[/b] commands apply to all labeled audio regions that are [i]fully inside[/i] a selection drawn in a label track.

If we want to prevent “Sound Finder” from placing the start of a label before time=0, (as happens with the modified version in my previous post), that is a feature request.

As I am intending to update Sound Finder (and Silence Finder) for Audacity 2.0.7, it would be very helpful if we could establish what behaviour we want for the first label.
Note that Nyquist plug-ins cannot currently distinguish between the start of a selection and the start of a track, so whatever behaviour is decided will apply to the selection even if the selection does not start at time=0 on the Audacity Timeline.

Is the design you mention the “Label starting point” or something else?

If we are marking a sound region, isn’t the objective to mark it as accurately as possible, so the default parameters would try to do that? So I am not sure why the defaults would label either side of the detected region. Or is it because there is an “attack time” and the effect cannot be expected to detect the “exact” start of the sound?

In fact I vaguely thought we already had a fix to prevent the first label going behind zero. If I set “Label starting point” to zero in the committed Sound Finder, the first label only is placed 10 ms after the start of the sound, so it seems the first label is treated differently.

Is Nyquist 4 addressing that inability to distinguish? it does seem important that the first label does not go behind time zero.


I’ll need to check the code…

Yes, the “Label starting point [seconds before sound starts]”, though the accuracy is limited to +/- 1/100th second.

Sound Finder (and Silence Finder) create an amplitude envelope that rides the peaks of the original waveform.
For faster processing, the envelope is at a relatively low sample rate.
It then searches (sample by sample) for where this envelope crosses the threshold level.
In Sound Finder, when it has determined that the sound is “valid”, it creates a region label.
The start position of the region label is:
“current sample number - label offset”
where “label offset” is the “Label starting point [seconds before sound starts]”

(- (/ sound-start s1-srate) labelbeforedur)

As the “envelope” is at a low sample rate, each sample in the envelope represents the peak level of a series of sample in the original waveform. In the current version the envelope sample rate is 1/100 of the original audio, so 441 samples at 44.1 kHz. So "as close as possible is 1/100th of a second.

I was not involved in creating Sound Finder, so I’m not certain of the intention, but it seems reasonable that when marking tracks for Export Multiple you will probably want a little space around the selected audio. Given the 1/100th second inaccuracy, you certainly would not want the label to chop off the first few milliseconds. The current default is to create a label with 0.1 seconds “space” around the sound (which may be +/- 1/100th second).

Most of my attempts to update these plug-ins disallow labels before zero.

I think that’s just the +/- 0.01 second inaccuracy.

All of my recent versions improve the accuracy to 100 samples (about 2 milliseconds at 44.1 kHz).

That’s the plan :smiley:

I think that would cover the vast majority of use cases.

  • The low sample rate envelope is created by looking at the peak value in steps of 1/100th of a second. Thus the first 1 sample of the envelope represents the peak level of the first 441 sample (at 44.1 kHz). We don’t know the exact point that the original sound crossed the threshold, just that it occurred at some point between one 10 ms block and the next, giving a maximum error of +/- 10 ms.

It did look like the first label was placed differently, unless there is something different about DTMF’s after the first one.


I’ve checked, and it is due to the 1/100 second inaccuracy.

To illustrate:

  1. Generate a tone (10 seconds)
  2. Select more than 1 second of the tone, starting on peak in the waveform (to avoid “near zero” samples at the start of the selection).
  3. Ctrl+B to add a label and give it some identifying text.
    4)Run Sound Finder with label start = 0

The entire selection is labelled (it is all “sound”).
Switch the Selection Toolbar to show “samples”. If the sample rate is 44.1 kHz, the offset is exactly 441 samples. This is the “step size” used when creating the low sample rate envelope.

It is arguably a minor bug that this case does not start the label dead-on the first sample (the first “step” being a sound).

(There is a trap if you change the sample rate of the track. The number of samples shown in the Selection Toolbar is for the Project Rate, not the Track rate).