Can you use ExtAudioFileWrite to append to a file?
I have an instance where I am using SetSpeechInfo(chan, soOutputToExtAudioFile, ...) and everything is working as expected.
I am looking to apply a specific number of frames of silence using
status = ExtAudioFileWrite(outputFile, frameCount, &conversionBuffer);
Strange enough
1) I get an error 29562 which I cant find anywhere
2) The buffer is written to disk, however it is more than the framecount (the entire buffer gets written)
3) The number of frames in the file is not updated
I request the framecount so that I know how many frames I need to write, I write the silence to the disk and then I request the framecount again. Although the framecount does *not* change, silence has been written to disk.
My buffer has a fixed number of frames, eight seconds of silence, but I only trying write a variable number of frames as needed, which is why the buffer is preset to the maximum. The level of precision in terms of frames written is high, otherwise I could use a less precise and functioning means of applying silence.
My guess is that there is no expectation that the file will be written to by the user, since it is open for writing speech to disk, however, I don’t know that is true.
Is there a way to open a file and just append using ExtAudioFileWrite?
I had an idea that, painfully I could close the file, reopen it and append the specific number of frames of silence, however it appears the only way to get the results that I want is to open the file, read it and rewrite the file with the silence at the end. This seems like a really crude way of handling the problem.
Thanks for any ideas,
W.