1

Trying to compress a 32 bit floating point waveform (raw binary). FLAC is out because it only goes up to 24 bits per sample. ALAC can handle 32 bits per sample.

I can encode directly from RAW to ALAC with the following command:

ffmpeg -f f32le -ar 4000 -ac 1 -i ts1.raw -acodec alac ts1.m4a

Note this works with any data file.

I have tried to set 32 bit sample size with -sample_fmt s32p but it always prints the message:

[alac @ 0x55dbbcc98a00] encoding as 24 bits-per-sample 

Decoding is done by:

ffmpeg -i ts1.m4a -f f32le -ar 4000 -ac 1 tsa.raw

I verify by loading the start and end raw files (ts1.raw vs tsa.raw) with Numpy (Python) and notice there is loss off precision. The result is closer to a 16 bit float but more precise (24 bit float makes sense). So basically I end up with a file containing 24 bit floats converted to 32 bit (lossy compression)!

How can I encode a 32 bits-per-sample lossless-compressed (for waveform data) file?

1
  • FFmpeg's ALAC encoder only supports 24-bit encoding.
    – Gyan
    Feb 5, 2019 at 5:23

1 Answer 1

2

according to https://support.apple.com/en-ca/HT212183 it is said that the entire Apple Music catalog is now also encoded using ALAC in resolutions ranging from 16-bit/44.1 kHz (CD Quality) up to 24-bit/192 kHz I am afraid u cant get a 32bit audio file

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .