How to merge ~700 very short, sequentially numbered, audio files into a single track?


I recently received hundreds of audio files from a government agency. They are numbered sequentially in the order they were recorded and each file is anywhere between 1 - 12 seconds in length. I am looking for a way to programmatically combine all of those into a single audio file, but haven't found anything.

Got anything for me? I'm hopeful that this won't end up being a manual operation!

(I have found plenty of solutions out there which would work for a small number of files, but nothing that works for my use case.)

Custom Soundtrack

Posted 2018-10-01T03:49:09.113

Reputation: 103

Question was closed 2018-10-12T14:06:00.147

sox can do this. You might find out that using mp3 files as input leads to gaps in the produced output (

– audionuma – 2018-10-01T05:55:10.870

May I ask why you want to do this? Obviously they were sent as separate files for a reason. – Mark – 2018-10-01T07:02:34.723

Mark - The audio is recorded radio traffic and the agency’s recording system only stores audio when someone transmits (metadata about the transmission is stored as well.) I want to listen to it in the car without having to put ~750 "songs" on my phone. Just what you thought, right? :) – Custom Soundtrack – 2018-10-01T07:32:31.780



SoX can merge several input audio files into one.

Basic example :

$ sox infile1.wav infile2.wav out.wav

If your files are stored in the same directory and are named in ascending order (like 001whatever.mp3 to 700whatever.mp3), you can merge them from the directory :

$ sox *.mp3 out.mp3

Notice that the input files will be re-encoded into the output, with quality loss as your input is mp3.

If the naming isn't numbered, that will require some logic into a script to merge them in correct order.


Posted 2018-10-01T03:49:09.113

Reputation: 2 449