I asked about a Non-Linear Editor for sound that works from plain-text files. As it does not seem to exist, I programmed one with FFMPEG. The text input is:
## take_1.wav -ss 3.32179 -to 7.57171 any notes on this ## take_1.wav -ss 11.82790 -to 15.22180 some more notes ## take_2.wav -ss 15.76000 -to 20.20920 more notes
and I extract those segments with FFMPEG:
ffmpeg -i take2.wav -ss 15.76000 -to 20.20920 -ac 1 temp3.wav
and then join them with Python's wave
module, from this answer:
def join_audio(infiles, outfile):
data = []
for infile in infiles:
w = wave.open(infile, 'rb')
data.append( [w.getparams(), w.readframes(w.getnframes())] )
w.close()
output = wave.open(outfile, 'wb')
output.setparams(data[0][0])
for i in range(len(data)):
output.writeframes(data[i][1])
output.close()
I notice some discrepancies at the joins between the segments. Since WAV is uncompressed, I assume that this slicing and joining is lossless. Is that correct or am I losing some information in the process?