Combining .wav files from the command line

0

I am currently in a directory with command prompt open, and combining wav files using the command

copy /b *.wav allAudio.wav

There are 29 wav files in this directory, each of them exactly 00:00:59 in length.

However, the combined "allAudio.wav" file generated by this command has a file size corresponding to all the merged .wav files in the directory, but the length of the file is only 00:00:59 just like all of the other .wav files in the directory.

This does not make sense to me. If anyone can explain this and suggest a way to actually merge the files such that the final file is correct in length would be great.

Here is the current directory

In total I have more folders containing several hundred wav files that need to be merged, so any software that merges one-at-a-time is not feasible for this task.

user02103012

Posted 2016-01-11T20:00:03.030

Reputation: 25

So does Windows have a utility like "shntool" for Linux that can strip RIFF headers in bulk? – user02103012 – 2016-01-11T20:06:56.210

Answers

3

This is because the RIFF header contains information about the duration of the file. You need to remove the RIFF headers from all files and create a new one describing the new file. You're treating them like RAW files, which they aren't

You can use sox for this, that would be a better approach

http://sox.sourceforge.net/

The windows binary download is at

http://sourceforge.net/projects/sox/files/sox/

You can also use it to render a png file containing the FFT data and stuff like that. It's a very neat tool.

https://stackoverflow.com/questions/9457020/merge-2-audio-files-in-sox

Daniel F

Posted 2016-01-11T20:00:03.030

Reputation: 751

It's funny you mention sox.

I was originally planning to use that utility where these files were originally located but there is no way for me to ssh into the server (blocked ports, firmware updates screwing up network protocols in Win10 rendering ethernet adapter useless).

So there's no native options in Windows to strip RIFF headers aside from 3rd party software? – user02103012 – 2016-01-11T20:11:24.467

I don't understand the problem. as long as you can copy /b you should also be able to run sox. Could you elabroate? – Daniel F – 2016-01-11T20:13:06.870

Let me clarify. Is sox a command I can use in Windows? I thought it was native to Linux. – user02103012 – 2016-01-11T20:14:02.523

1SoX is a cross-platform (Windows, Linux, MacOS X, etc.) – Daniel F – 2016-01-11T20:14:33.127

Updated the answer with the download link – Daniel F – 2016-01-11T20:16:13.420

1Yes, I see that now from the link you provided. This greatly helps. I will try using this utility and Google/man-page if anything comes up. – user02103012 – 2016-01-11T20:16:52.090