[flac-dev] Encoder example for 24-bit files

lvqcl lvqcl.mail at gmail.com
Thu Aug 14 11:34:54 PDT 2014


Jose Pablo Carballo <jose.carballo at ridgerun.com> wrote:

> - channels = 2;
> - bps = 16;
> + channels = ((unsigned)buffer[23] << 8) | buffer[22];
> + bps = ((unsigned)buffer[35] << 8) | buffer[34];
>   total_samples = (((((((unsigned)buffer[43] << 8) | buffer[42]) << 8)
> | buffer[41]) << 8) | buffer[40]) / 4;
>

I suspect that the expression for total_samples should be not

(.....) / 4

but

(.....) / (channels * bps/8)


More information about the flac-dev mailing list