WavPack 4.70.0 beta version available
Reply #15 –
- experimental, undocumented option to store float16 and float24 audio data as integers (--store-floats-as-ints)
Since it's not officially documented, I'll share my findings about such files here:
Code to determine the real wave format tag of from a WavPack context - presuming context to have been opened with OPEN_WRAPPER:
static uint32_t WavpackGetFormatTagFromWrapper(WavpackContext * wpc ) {
uint32_t bytes = WavpackGetWrapperBytes( wpc );
uint8_t * ptr = WavpackGetWrapperData( wpc ) ;
uint32_t fmtOffset = 8 + 12;
if (bytes < fmtOffset + 2) return 0;
if (memcmp(ptr, "RIFF", 4) != 0) return 0;
if (memcmp(ptr + 8, "WAVEfmt ", 8) != 0) return 0;
return (uint16_t) ptr[fmtOffset] + ((uint16_t) ptr[fmtOffset+1] << 8);
}
static uint32_t WavpackGetFormatTag(WavpackContext * wpc ) {
uint32_t v = WavpackGetFormatTagFromWrapper( wpc );
if (v == 0) {
if ( WavpackGetMode( wpc ) & MODE_FLOAT ) {
v = 3;
} else {
v = 1;
}
}
return v;
}
Please correct me if the above is wrong.