Append samples to an existing wav file

Hi,

Is there a way to append samples to an existing .wav file? I can do this no problem with a new audio file using an OutputStream and AudioFormatWriter, and keep adding samples to it before deleting the AudioFormatWriter. But if I open an existing audio file that already has audio, this doesn’t seem to work and the original file stay untouched.

I checked the OutputStream::getPosition() and it seems to be correctly placed at the end of the file. Is there any obvious trick that I am missing to be able to do this?

Thanks!

1 Like