Truncate Silence to .5 second AND exporting questions

I have recently just transitioned to Ardour from Audacity and I’m still learning. The way I cut up the podcast files I edit sometimes leaves a few seconds of silence between parts. When I used Audacity, after I did the editing and mixdown, my final step was to do a truncate silence so all those silences were cut down to .5 seconds. It worked great.

The last episode of the podcast I used Ardour almost entirely, but I brought the final FLAC file into Audacity, and did a truncate silence. Then from within Audacity, I exported as a FLAC, an OGG, and an MP3 files. I’d love to keep it all in Ardour if possible, I like it so much better than Audacity.

In Reddit a user kindly gave me an FFMPEG script they use in terminal, I’m on Linux too, but said that I could click the edit button and add the FFMPEG commands in Ardour so I wouldn’t need to open Audacity. I’ve tried it a few ways, and can’t seem to get it correct. I see where I can put scripts but I don’t need all the metadata, I just want the truncate silence part.

Does anyone know how much I can cut off from this script? I’m on Ardour 6.5, the podcast has between 4-7 guests each time, and I do a separate export for each of the file types, unless using FFMPEG I could do it once, truncate the silences, and do all 3 exports.

ffmpeg -i %f -c libmp3lame -b:a 96k -ar 44100 -ac 1 -af silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-40dB:detection=peak -metadata title=“Episode 3xx - Something” -metadata artist=“Atheist Nomads” -metadata album_artist=“Atheist Nomads” -metadata album=“Atheist Nomads” -metadata date=“2020” -metadata track=“xxx” -metadata comment=“Released on 2012-” -metadata copyright=“2020 Dustin Williams” %d/%b.mp3

Any direction would be appreciated.

I would suggest using SOX instead of FFMPEG for a less complex structure.

From the command line, SOX can do what you need with:

sox input.mp3 output.mp3 silence 1 0.1 -60d reverse silence 1 0.1 -60d reverse

This finds any signal less than -60db with a duration of more than 0.1 seconds and strips it out, reverses the files, does the same to what used to be the end silence, and reverses it back to play normally. If you don’t want to trim the end of the files, just use:

sox input.mp3 output.mp3 silence 1 0.1 -60d

When you have the db level and duration variable set for your files, you can paste the command line into Ardour with a few small changes.

From Export Selection, Edit your Format and in the Post Export field at the bottom (this is Ardour 6.x) paste:

sox %d/%b.mp3 %d/%b-trimmed.mp3 silence 1 0.1 -60d reverse silence 1 0.1 -60d reverse

The %d and %b are from your output directory and filename setting in Ardour and are handed off to SOX for processing.

Thanks for the reply. I’ve just been using Audacity for truncating silence, but I’ll give SOX a try, although, truthfully, I don’t follow everything.

I assume that if I want to make any silences longer than 0.5 just be 0.5 seconds, I"d use 0.5 instead of 0.1.

I’ll try it out. I just exported this week’s episode using Audacity, so I could test in Ardour. Thanks again.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.