Hey all-
Is there a way to append samples to the end of a wave file in PD? I'm working on some voice activity detection stuff, and I basically want to read in a multi-channel wave file, determine if every 80 samples is speech or non-speech, and add another channel that contains the information about speech / non-speech.
I would like to write all of the original channels, plus the new channel, to a new wave file. My concern is that the channels will be too large to simply load them all into arrays, and then write out all the arrays (maybe I'm wrong and maybe I should just do that). I would like to basically...
read in 80 samples
determine speech
write out 80 samples (on all 5 channels)
repeat until the end of the file
Is there any way to do this? Or should I just try to load them all into arrays and just write the file @ the end (the files are like 20 minutes each, 4 channels, 8kHz).
I've looked at soundfiler (will let you skip parts of the array, but not parts of the file) and writesf (seems to only write in real time; stopping must be followed by an open before more writing, which overwrites the file)...
Any help would be appreciated!
All the best,
-Zach