Make sure you pass the correct params to header, except,
if you have a seekable stream, the data length can be zero
and it will be fixed when you close. If you have a non-seekable
stream though, you must give the size up front.
If you need to go to memory, the best way is to just
append your data to your own buffer, then create a WavFileHeader
separately and prepend it. Wav files are simple, aside from
the header and maybe a terminating byte (which isn't really important
anyway), there's nothing special going on.
Opens the file with the given header params.
Make sure you pass the correct params to header, except, if you have a seekable stream, the data length can be zero and it will be fixed when you close. If you have a non-seekable stream though, you must give the size up front.
If you need to go to memory, the best way is to just append your data to your own buffer, then create a WavFileHeader separately and prepend it. Wav files are simple, aside from the header and maybe a terminating byte (which isn't really important anyway), there's nothing special going on.