I am able to join and crossfade two audio files using SoX, like so:
sox file1.wav file2.wav outfile.wav splice -q `soxi -D file1.wav`,0.5
where the soxi substitution is fetching the duration of file1 and 0.5 is the length of the cross-fade. I am now trying to extend this to an arbitrary number of files, in order to string them together with short crossfades in between. There would seem to be 2 approaches: piping and scripting. Sox has a -p option telling it to treat it's output as piped (instead of writing a file). But, with many input and arguments per command, it's not clear how that output (and input?) gets assigned in subsequent commands. So far I've got the line below, which does not work, trying to extend to 3 files.
sox -p file1.wav file2.wav splice -q `soxi -D file1.wav`,0.5 | sox -p file3.wav outfile.wav splice -q `soxi -D file3.wav`,0.5
Your tips on sox piping and scripting would be greatly appreciated.