I am developping a tool which reads audio samples from a file, does some processing with it and writes the processed sample data back to the file.
My problem is by using an AudioFormatWriter to write to the file, the samples get appended to the file and don’t replace the original samples.
The approach to delete the file first and create a new file with the new samples does not work for me since all the meta data gets lost. I already tried this approach with also reading and writing all meta data but it doesnt work for all meta tags.
Is there some way to only replace the sample data in a wav file and keeping all the other fields as they are?