fons(a)kokkinizita.net wrote:
I'm well aware of this.
Good.
For the headers the byte-swapping overhead is
really without consequence,
Thats why I didn't mention it :-).
Another feature I like is that provided the headers
are flushed to
disk and the data length set to -1 you get a valid file even if
it is was not closed cleanly, e.g. as a result of a power failure
or software crash. Does libsndfile do the right things to support
this ?
By default, it doesn't do the right thing if the file is not properly
closed, but it is possible to force update of the header using:
http://www.mega-nerd.com/libsndfile/command.html#SFC_UPDATE_HEADER_NOW
http://www.mega-nerd.com/libsndfile/command.html#SFC_SET_UPDATE_HEADER_AUTO
The second of these updates the header at the end of each write. As
long as you are doing large writes, the overhead should be negligible.
I'll also look into doing what you suggest, writing the maximum
value for the data field length when the file is initially opened.
Cheers,
Erik
--
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/