Trim Silence

Archive of Nyquist Plug-ins.
Many of the plug-ins here will be available on the Audacity Wiki.

This Forum is an archive of old topics concerning Nyquist plug-ins.

Feedback and questions relating to topics may be posted, but please
DO NOT POST NEW TOPICS HERE.

New plug-ins may be posted on the New Plug-Ins board.
Other posts relating to Nyquist should be posted to the main Nyquist board.

The main repository for Audacity/Nyquist Plug-ins is on the Audacity Wiki.

Trim Silence

Permanent link to this post Posted by steve » Mon Aug 01, 2011 5:56 pm

Trims silence from the start and the beginning of the selected audio.
The major difference between this effect and "Truncate Silence" is that this effect will never affect silences within the audio. It only acts on audio at the start and end of the selection.

After processing there may still be a few milliseconds of silence at the beginning/end, particularly on longer tracks (several minutes). This is by design to allow reasonable processing speed and to avoid trimming off non-silence. On short audio tracks (a few seconds) the trimming will be very close to the start of the audio (little or no silence will be left at the start /end of the selection).

This effect requires Audacity 1.3.8 or later.

This effect is supported in Chains in Audacity 2.0.1 and later.

As with other Nyquist effects it can be very slow and may cause Audacity to crash if used on very long selections (tracks of several hours or more duration).

OBSOLETE VERSIONS:
TrimSilence.ny
(2.2 KiB) Downloaded 1145 times

TrimSilence.ny
Current version: http://wiki.audacityteam.org/wiki/Nyqui ... im_Silence
Last edited by steve on Wed Oct 21, 2015 5:10 pm, edited 6 times in total.
Reason: Updated links
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Senior Forum Staff
 
Posts: 41267
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux Debian

Re: Trim Silence

Permanent link to this post Posted by steve » Thu Oct 06, 2011 8:09 am

As with many other plug-ins, this effect may create a "split" in the track at the end of the processed selection. To remove this split, press Ctrl+J (Join).
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Senior Forum Staff
 
Posts: 41267
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux Debian

Re: Trim Silence

Permanent link to this post Posted by theDarkness » Thu Oct 06, 2011 10:35 pm

I have some compact disc music albums that play seamlessly on cd players, with no gaps between one track and the next (eg one hour of continuous music by some orchestra or random dj). Unfortunately, when playing back these albums ripped to mp3, very short gaps (or "clicks") can be heard on some mp3 players whilst it moves from one mp3 to the next. This can be annoying on albums with very short tracks, especially if one "song" can be made up of more than one track too. Ripped mp3s have a few milliseconds of silence by nature at the start (and possibly also end) of each file, and not all mp3 players can leave this out during playback either (especially portable java mobile players), I therefore wanted to remove the silence on each mp3, and finally combine all the tracks together, so that I could listen to the album on these players seamlessly. With 38 (!) previously ripped mp3 tracks from one album, I have now managed to remove the silence from each track using this plugin using its default settings. I remove the silence from one track, add a new track, remove the silence from that also, and then finally cut and paste it onto the end of the last, and so on. Very little editing was needed. On a few short occassions (after zooming in to almost fill the screen) some silence would still be present in the graphic after joining files together and removing the split, but it would usually sound seamless. If it didnt I just had to zoom in to remove the gap (to join the two files completely), then zoom out to check if it sounded 'as one'. I believe that some of the silence still being present may have been down to audacity adding some whilst cutting and pasting one track onto the end of another. If that isnt possible, I simply could have played more with this plugins settings to be more accurate in its deletion of silence, but the plugin definately made a difference. In the end this has given me one single mp3 that plays with no obvious clicks/silence-perfect for my portable player. It didnt take as long as I thought it would either :mrgreen: but next time I might consider using a ripper that can rip my albums as one single mp3 :roll: cheers
theDarkness
 
Posts: 9
Joined: Tue Oct 04, 2011 1:07 pm
Operating System: Please select

Re: Trim Silence

Permanent link to this post Posted by steve » Mon Sep 24, 2012 9:29 pm

This version fixes a bug in which silence could be detected incorrectly in some stereo tracks.

Memory usage has also been reduced a little.
To prevent Audacity freezing or crashing if RAM becomes full, RAM usage is limited to (approx) 1 GB (about 47 minutes for a stereo track at 44.1 kHz)

Modification tip:
Users that have more physical RAM available and want to process longer files can increase the maximum size by following the instructions in the comments near the top of the plug-in code.

TrimSilence.ny
(3.37 KiB) Downloaded 3371 times
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Senior Forum Staff
 
Posts: 41267
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux Debian

Re: Trim Silence

Permanent link to this post Posted by johnfox » Sun Nov 18, 2012 4:28 pm

How can I modify your plugin to leave 1-2 seconds of silence at the end of each track?
johnfox
 
Posts: 2
Joined: Sun Nov 18, 2012 4:26 pm
Operating System: Please select

Re: Trim Silence

Permanent link to this post Posted by steve » Sun Nov 18, 2012 6:27 pm

johnfox wrote:How can I modify your plugin to leave 1-2 seconds of silence at the end of each track?

To leave 2 seconds of the silence, find the part that says:

Code: Select all
    (let ((start (/ (first result) my-srate))
          (end (- (get-duration 1)(/ (second result) my-srate))))
      ;; ensure at least 1 sample remains
      (if (>= start (get-duration 1))
        (setq start (/ (1- len) *sound-srate*)))
      ; trim
      (multichan-expand #'extract-abs start end (cue s))))


and change it to:
Code: Select all
    (let ((start (/ (first result) my-srate))
          (end (- (get-duration 1)(/ (second result) my-srate))))
      ;; ensure at least 1 sample remains
      (if (>= start (get-duration 1))
        (setq start (/ (1- len) *sound-srate*)))
      ; add up to 2 seconds to end and trim
      (if (<= (+ end 2) (get-duration 1))
          (setq end (+ end 2))
          (setq end (get-duration 1)))
      (multichan-expand #'extract-abs start end (cue s))))
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Senior Forum Staff
 
Posts: 41267
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux Debian

Re: Trim Silence

Permanent link to this post Posted by johnfox » Sun Nov 18, 2012 9:13 pm

Thanks for your quick reply. Works great now.
johnfox
 
Posts: 2
Joined: Sun Nov 18, 2012 4:26 pm
Operating System: Please select

Re: Trim Silence

Permanent link to this post Posted by geoyo » Fri Apr 05, 2013 7:09 pm

Did you make this plugin, steve?

In any case, this plug-in is awesome. Some CDs have a few seconds of silence at the beginning and end of each track, which can be annoying. I use the plug-in in batch mode to trim the silence. Works like a charm!

For the record, there is a little tool called mp3directcut ( http://mpesch3.de1.cc/mp3dc.html ), which can losslessly auto-trim silence in MP3 and AAC files, that is, without recompressing them. So if you need to trim silence on already compressed files, this is the best way.
geoyo
 
Posts: 3
Joined: Fri Apr 05, 2013 2:52 pm
Operating System: Please select

Re: Trim Silence

Permanent link to this post Posted by steve » Fri Apr 05, 2013 10:22 pm

Yes, this is one of my efforts.
Thanks for the feedback - I'm glad you find it useful.

Yes, mp3directcut is a useful tool for trimming MP3s.
There is also Mp3splt which can split MP3s (an Ogg files) losslessly http://mp3splt.sourceforge.net
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Senior Forum Staff
 
Posts: 41267
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux Debian

Re: Trim Silence

Permanent link to this post Posted by timar146 » Sat Dec 14, 2013 4:46 pm

Hi Steve,

This is a great plugin, it's work fine manually but I don't add it in Chain script.
Maybe you can help doing it?
I have a hundreds of mp3 files to trim and convert to ogg. Doing it manually are killing me :-)
Thanks
timar146
 
Posts: 3
Joined: Sat Dec 14, 2013 4:16 pm
Operating System: Please select

Next

Return to Plug-in Archive



Who is online

Users browsing this forum: No registered users and 0 guests