how to remove some portion of audio for some seconds ..

how to remove some portion of audio for some seconds …
I have 20 mins audio file…for every 10 seconds .i need to remove 3 seconds of audio clip automatically…Is it possible…

Do you mean at exactly regular intervals? If so, is the 3 seconds included in the 10 seconds?

What do you mean by “remove”? Just silencing the audio, or deleting it completely so that the track becomes shorter?

Does it matter that the remaining audio will have abrupt changes (and possibly “click”) at each edit point?

yes i want to remove 3 seconds …

  1. Select the audio.
  2. Apply this code in the Nyquist Prompt (see: https://manual.audacityteam.org/man/nyquist_prompt.html)
;version 4
;type analyze tool

;control cut "Length to cut (seconds)" float "" 3 0 100
;control skip "Length to skip (seconds)" float "" 10 0 100

(defun make-labels ()
  (let ((dur (/ len *sound-srate*))
        (labels ())
        (start skip)
        (end (+ skip cut))
        repeats)
    (setf repeats (truncate (/ dur (+ cut skip))))
    (dotimes (i repeats labels)
      (push (list start end "") labels)
      (setf start (+ start cut skip))
      (setf end (+ start cut)))))

(if (or (=  cut 0) (= skip 0))
    "Error.\nBoth controls must be greater than zero."
    (make-labels))
  1. Press “Ctrl + A” (select all)
  2. “Edit menu > Labelled Audio > Delete”

Thank you sp much …love you

Out of interest - what is this for?

for avoiding copy rights… :ugeek: :ugeek:

I hope you mean “protecting your copyright” rather than bypassing someone else’s.

yes protecting my rights…

A common and effective way to do that is to add a “watermark” to the recording.
The “watermark” is usually a spoken word such as “Demo” or the name of your website - it can be anything, but there’s added value in using something “promotional” such as your web address.

To make the watermark very difficult to remove, use a stereo effect on it, such as Reverb.

To apply the watermark:

  1. Import the main audio track.
  2. Import the short “watermark” audio
  3. Select the “watermark” audio plus say 10 seconds of silence.
  4. Use the “Repeat” effect to repeat the selected “watermark + silence” enough times to be the same length as the main track.
  5. “Ctrl + A” (select All)
  6. “Tracks menu > Mix > Mix and Render”
  7. If necessary, “Normalize” the track so that it does not clip.
  8. Export.

Hi, I have a question. I would like to remove 3.5 seconds every hour. Could I use the same code and replace the 10 by 3600 and the 3 by 3.5? Or does it work differently? This would really help me out! :slight_smile:

Basically yes, but there’s one other thing that you need to do.

The three numbers at the end of each “;control” line are the default, the minimum, and the maximum values for that control (see: Missing features - Audacity Support)
So, for the “skip” control:

;control skip "Length to skip (seconds)" float "" 10 0 100

The default time is 10 seconds.
The minimum skip time is 0 seconds.
The maximum skip time is 100 seconds.

Obviously 3600 is bigger than the control’s maximum, so you will need to increase the maximum.
This will do it (and also sets the defaults to the times that you require):

;version 4
;type analyze tool

;control cut "Length to cut (seconds)" float "" 3.5 0 100
;control skip "Length to skip (seconds)" float "" 3600 0 4000

(defun make-labels ()
  (let ((dur (/ len *sound-srate*))
        (labels ())
        (start skip)
        (end (+ skip cut))
        repeats)
    (setf repeats (truncate (/ dur (+ cut skip))))
    (dotimes (i repeats labels)
      (push (list start end "") labels)
      (setf start (+ start cut skip))
      (setf end (+ start cut)))))

(if (or (=  cut 0) (= skip 0))
    "Error.\nBoth controls must be greater than zero."
    (make-labels))