Topic: Is FLAC sample a signed or unsigned integer. (Read 630 times)
0 Members and 1 Guest are viewing this topic.

Is FLAC sample a signed or unsigned integer.

2019-12-04 18:55:39
A basic question I'm afraid! Wikipedia https://en.wikipedia.org/wiki/FLAC says
Quote
FLAC supports only integer samples, not floating-point (signed/unsigned?). It can handle any PCM bit resolution from 4 to 32 bits per sample, any sampling rate from 1 Hz to 65,535 Hz in 1 Hz increments or from 10 Hz to 655,350 Hz in 10 Hz increments, and any number of channels from 1 to 8.
It doesn't say whether these integers are signed or unsigned though, and I can't find the information anywhere else. Is there a choice, if not which is it?

Re: Is FLAC sample a signed or unsigned integer.

Flac samples are unsigned, FWIW.  The significance of being unsigned is that a bits per sample of n represents a sample in the range zero to 2^(n-1).  That almost misses the point of how Flac samples are actually represented, since they are a sequence of bits independent of any particular hardware representation of integers.  They are stored as 4-32 bit (in practice only up to 24 bit in any current implementation) unsigned integer "words" stored in big-endian format.  An encoder can of course represent Flac samples any way it chooses internally, including as signed integers of a sufficient size.

Re: Is FLAC sample a signed or unsigned integer.

A basic question I'm afraid! Wikipedia https://en.wikipedia.org/wiki/FLAC says
Quote
FLAC supports only integer samples, not floating-point (signed/unsigned?). It can handle any PCM bit resolution from 4 to 32 bits per sample, any sampling rate from 1 Hz to 65,535 Hz in 1 Hz increments or from 10 Hz to 655,350 Hz in 10 Hz increments, and any number of channels from 1 to 8.
It doesn't say whether these integers are signed or unsigned though, and I can't find the information anywhere else. Is there a choice, if not which is it?

This question doesn't make sense. What are you actually trying to do?

Re: Is FLAC sample a signed or unsigned integer.

The output is signed or unsigned depending on whether the input was signed or unsigned. In other words the output is identical to the input, whatever that was.