I’m looking for a utility that allows me to trim the audio from the beginning and end of all audio files in a directory. I’ve found a couple of programs in searches, but nothing that quite meets my feature requirements. Specifically, I’m looking for something that can:
Trim the beginning and end only, skipping any silences within the file
Modify the original file rather than creating a new file. Alternatively, if that isn’t available at least the option to preserve the original’s file name in the copy as well as the original directory structure.
The other options I’ve found, such as mp3splt, mostly appear to create new files with edited filenames. As the batch of files which I would like to edit is spread throughout multiple directories and subdirectories, I would much rather edit the original files and preserve the file structure than manually attempt to sort everything back into the correct place.
for x in $(ls --file-type *.mp3);
echo "ffmpeg -i $x -af 'silenceremove=start_periods=1:start_duration=1:start_threshold=-60dB:detection=peak,aformat=dblp,areverse,silenceremove=start_periods=1:start_duration=1:start_threshold=-60dB:detection=peak,aformat=dblp,areverse' $x";
I just tried this solution, but judging from the terminal output it didn’t touch any of the files in sub-directories, only the files that were in my Music directory. Also,I listened to a couple of sample files in the Music directory, and it appears that there still is silence at the beginning of these files.