Paste background noise recording into selection

I have a spoken word track that has strong background noise. The background noise is a fairly constant nature sound. When I delete parts of the track, it sounds fine. However, when I silence parts of the track (the project has multiple synced tracks, so to eliminate a sneeze I need to silence, not delete), I of course get abrupt changes in the background noise that are unpleasant. I have found a nice long stretch of the background noise that I can copy from, and paste over the part I want to silence, and this sounds good.

What I would like to do is create a macro that lets me paste the background noise into a selection. The problem is that I don’t really know how to do this even without a macro. Is there a way to copy (for example) 10s of the background noise, and paste it into a selection that is only 2 seconds so that only the first 2 seconds of the copied audio are pasted, leaving the length of the track the same?

Or is there a way to get write a macro to get the length of the selection I want to silence, and randomly select a length of audio from a recording of the background, and then use that to overwrite the audio I want silenced?

(I use Linux) Thanks so much!

There’s already a plug-in available to help you do that:

(actually it is two plug-ins, one for copying and one for pasting.)

The user documentation for is in that post.
Installation instructions are here: https://manual.audacityteam.org/man/installing_effect_generator_and_analyzer_plug_ins_on_linux.html#nyquist_install
(It’s a “Nyquist Plug-in”)

Oh wow, that’s great! Sorry for the post.

The background noise is a fairly constant nature sound.

Are you planning on publishing as an Audiobook? Is this your reading or someone else?

Koz

It’s a friend reading, it won’t be published as an audio book, it’ll be inserted into a podcast. Why do you ask? Can Audiobook’s not have background noise?

Audiobook publishers are often very fussy about the amount of background noise (or as they tend to refer to it: “room tone”).