Sample rate mismatch, 0.001 or shorter silence every batch.


As the title states, I’ve recorded podcast episode with accidentally mismatched sample rate between DAW and the hardware, or something like this. I was terrified when after the recording i found, that my 1 hour long episode has this clicking robotic sound effect. I know, that there’s nothing much that I could do to fix this. What I’ve done so far:
I tried de clipping, but it doesn’t help at all
Truncate silence doesn’t work as well, the silence gaps are in fact not really silence and they’re occuring in following pattern:
There’s ~0.0008 second long (around 30 samples) silence every 0,01 second and this is constant. Truncate silence doesn’t accept silence of that length.
I’ve noticed it by zooming the waveform, which is showed on the screen below. When I’ve “cleared” part of audio manually (some minutes to get 1 second of audio, so that’s not really efficient)

And the question is, if there’s a way to clear that audio? The best would be to delete every part of silence, because it can be seen, that when the silence is deleted the wave “before” and “after” it are matched perfectly.

Thanks for any help in advance,

There’s how it looks at some zoom, it can be seen that is is repeating
z daleka.png
And the’res big zoom, which shows that if we delete the “silence”, waveform will “match”
z bliska.png

When you say “DAW” do you mean Audacity?
If so, which version do you have?

If you have Audacity 2.4.2 there should have been labels added at each of those silences (they are called “dropouts”), unless you disabled “Detect dropouts” in the Recording Preferences.
Are the silences labelled, or is dropout detection disabled?

I’m not aware of any effect that can fix that, though it may be possible to make one using Nyquist (See;
Your screenshot shows a mono track, and I assume that is what you want to fix. Is that correct?

Does your manually repaired part play perfectly? (There’s no point in us spending a lot of time on this if the repaired audio still sounds rubbish).

Thank You for the reply!

I have Audacity 2.4.2, but I didn’t use it for recording this time. So I Guess that it is not labeled. Is there way to “enable” them or make wisible? (the labels)

Yes, my track is mono and that’s what I want to fix.

And yes, the part that i’ve cleared manually, which was not super-precise made it good enough to post it with little apology for listeners, but it would save me from recording again.

As a preliminary test, try running this code on a short section of the track that contains dropouts.
To run the code, copy and paste it into the Nyquist Prompt and click the OK button to apply (see:

;version 4
;type process

(setf num 3)

(let ((sil-flag 0)
      (labels ()))
  (do ((i 0 (1+ i))
       (val (snd-fetch *track*) (snd-fetch *track*)))
      ((not val))
      ((= val 0)
          (setf sil-flag (1+ sil-flag)))
      (t  (when (> sil-flag num)
            (push (list (/ i *sound-srate*) "") labels))
          (setf sil-flag 0))))
  (if labels
      "No silences found"))

What happens?

Unfortunately, i’m receiving “No silences found”. Thank You very much for trying to help - I’m attaching small part of the audio maybe it could help

Unfortunately this does not appear to be possible to automate with that audio.

Here’s the problem. Try running this code:

;version 4
;type analyze

;control num "Minimum run of samples" int "" 10 1 100
;control thresh "Silence threshold (dB)" int "" -80 -120 -20

(setf thresh (db-to-linear thresh))

(let ((sil-flag 0)
      (labels ()))
  (do ((i 0 (1+ i))
       (val (snd-fetch *track*) (snd-fetch *track*)))
      ((not val))
      ((< (abs val) thresh)
          (setf sil-flag (1+ sil-flag)))
      (t  (when (> sil-flag num)
            (let ((start (/ (- i sil-flag) *sound-srate*))
                  (end (/ i *sound-srate*)))
            (push (list start end "") labels)))
          (setf sil-flag 0))))
  (if labels
      "No silences found"))

Notice that if you set the threshold high enough to catch all the dropouts, it also labels sound that should not be deleted.
On the other hand, if you set it low enough to avoid labeling parts that should not be deleted, then the dropouts are not all completely marked.

Dropouts are normally “absolutely” silent, so I’m wondering why they aren’t in your audio sample. What app did you use for recording? Was it recorded in MP3 format?

It was recorded in audition into wav format.

Hey, how about this:

I’ve checked that:
Gap is always 33 samples long
Gap always starts after 479samples since previous one has ended

Could we prepare script which would basically do this:

User selects first gap manually

start := selection Start
end := selection End
interwal:= 479samples

And make loop through whole file doing this:

Delete selection
start += interwal
end += interwal

So it would be based on hardcoded “distance” between dropouts, not the detection mechanism. What do You think? Is it possible to delete in script?

Or maybe we could modify script You provided in last comment to select dropouts exactly with length of 33?

Yes, that’s quite simple. I think the numbers that we need are 32 samples for the gap, and then skip 480 samples before the next label

This code will create labels that are 32 samples long, starting from the beginning of the selection:

;version 4
;type analyze

(setf count 32) ;number of samples to label
(setf skip 480) ;number of samples to skip

(setf cycle (+ count skip))

(let ((labels ()))
  (do ((start 0 (+ start cycle))
       (end count (+ end cycle)))
      ((>= end len) labels)
    (push (list (/ start *sound-srate*) (/ end *sound-srate*) "") labels)))

This will create a huge number of labels, which will be very demanding for Audacity and your computer. I would highly recommend that you process your recording a bit at a time rather than all in one go. Audacity should be able to handle a thousand labels or more, but not hundreds of thousands of labels.
Start with a small test section to see how it goes.

Luckily we don’t need to do that :slight_smile:

Once the labels are in the correct place:

  1. Select All
  2. "Edit menu > Labelled Audio > Delete (see:

The result is not perfect, but it’s a big improvement.

Tip: You could use the “Repair” effect to improve some of the worst remaining glitches. See:

Thank You so much for all the professional help.

That’s all, take care!