how to concatenate 2 or more sound files?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



how do i concatenate two or more sound files together into one sound file?
cat * >somefile.wav wouldn't work, because of the wave headers.
the files are all in the same format.
i found a way of doing it, but it is rather annoying.
here's my way, if anyone wants it.
head -c 40 something.wav >file.wav
this will get the wave header and put it in file.wav
wc -c something.wav
getst eh size
bc
size-40
gets the size, minus 40.
tail -c size something.wav >>file.wav
gets the wave data. size is the size you got with bc.
wc -c someother.wav
bc
size-40
same as above.
tail -c size someother.wav >>file.wav
same as above. you have file.wav
with the two files concatenated. now:
sox file.wav file2.wav
will convert it into a proper wave file.
i wouldn't recommend this, since it is slow, but it works when you need it,
if the files are the same format.
or at least it should...




[Index of Archives]     [Linux for the Blind]     [Fedora Discussioin]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]
  Powered by Linux