libbw64 icon indicating copy to clipboard operation
libbw64 copied to clipboard

Extensible float

Open pwnified opened this issue 2 years ago • 1 comments

Not sure if project is still maintained but I added some features that I use, a bugfix or two

pwnified avatar Aug 06 '23 23:08 pwnified

Thanks for the contribution -- yes, we're still alive, there's just not much need for constant changes in a library like this.

re. the padding issue, what software generates files like this? They are invalid; riffmci.pdf says:

If the chunk size is an odd number of bytes, a pad byte with value zero is written after ckData

I'm not keen on accepting invalid files, even if it's just a technicality, as that's what leads to issues like this in the first place. Other software I've tried (sox, ffmpeg, audacity) accepts files with this issue, but writes correctly.

Perhaps this could be dealt with by adding an explicit compatibility mode, or a way to issue warnings.

re. floating point, yeah, that's a good idea. I think it was not added because it's not part of the BW64 spec. There are a few changes required I think:

  • as per your note, this should be supported in the read and write methods
  • i'm not keen on adding more parameters to the Bw64Writer constructor, as it's hard to extend in the future and easy to mess up. I'd probably add a new constructor which accepts a FormatInfoChunk directly, and add setter methods to that.
  • there are a few small changes which should be pulled out into their own commits
  • there's no tests for the new functionality
  • don't use macros for type/subtype definitions, as they break namespacing

I can probably do some of these, but it might be some time before I can work on it.

Thanks again.

tomjnixon avatar Aug 07 '23 11:08 tomjnixon