The QNX Sound Architecture supports a variety of data formats.
The <sys/asound.h> header file defines two sets of constants for the data formats. The two sets are related (and easily converted between) but serve different purposes:
Generally, the SND_PCM_FMT_* constants are used to convey information about raw potential, and the SND_PCM_SFMT_* constants are used to select and report a specific configuration.
You can build a format from its width and other attributes, by calling snd_pcm_build_linear_format().
You can use these functions to check the characteristics of a format:
Data for 24-bit audio is represented as either 3 bytes or 4 bytes.
In most cases, audio files store 24-bit data as 3 bytes.
Because your hardware likely requires 32-bit aligned data access, the 24-bit data is usually converted to 4 bytes. The 24-bit sample in the 32-bit integer can have one of the following types of alignment: