I have a radio archival tool (trunk-recorder) that records and saves radio transmissions as individual unix-timestamped wav files. Each of these files is relatively short (~5-10s) and contains the channel that was recorded and the unix time stamp of the beginning of the recording. So far, I have a script that separates them out by channel number/name with resulting folders containing files like the following:
...
101-1681428717_442450000.wav
101-1681428644_442450000.wav
101-1681428582_442450000.wav
...
As far as total number of files goes, I archive 25 or so channels with each one averaging 30 or so clips per hour.
I'm wondering what the most efficient way would be to combine these files into longer recordings properly divided by time, something like 30-minute clips starting on the :00 and :30 of every hour. The time-division part I can handle with python relatively easily, but the actual encoding of each file has so far been a challenge. I tried out PyAV (which is just pythonic bindings for ffmpeg as far as I'm aware), and while my script did work, it was extremely resource intensive, slow, and the resultant audio quality was not very good, due to decoding and re-encoding every file (for instance, it occupied all 8 cores of my server at 100% CPU for 20 minutes to properly combine the previous 30 minutes of audio for 20-ish channels of recordings). I'm wondering if anyone has ever tried to do something like this before, and what solutions have worked well.