[alsa-devel] Selecting Audio formats

Clemens Ladisch clemens at ladisch.de
Thu Jul 19 20:35:36 CEST 2012


Harman Kalra wrote:
>     Can you please explain difference between signed and unsigned PCM
> formats,

Signed PCM formats have a sign, unsigned don't.  S16 allows values in the
range -32768..32767, U16, 0..65535.

> in what cases does unsigned is used,

In practice, never.  It was historically used by some 8-bit cards.

> which is more efficient (memory and sound clarity)

I refer the honourable gentleman to the reply I gave in the last mail.

>> If you tried to set MPEG format, ALSA would inform you that the device
>> does not support this.
>
>         But when I queried the hardware regarding the supported audio
> formats using the api " snd_pcm_format_name", it responded with a list of
> formats, including , A-law, u-law-, IMA_ADPCM, MPEG, GSM, so what does it
> mean.

It means that the sample format identified by the constant
SND_PCM_FORMAT_MPEG is indeed named "MPEG".  This has nothing to do
with what formats some particular hardware supports.

>       What would be audio sample file size in case of A-law, will it be
> same as U8.

I refer the honourable gentleman to the reply I gave in the last mail.


Regards,
Clemens


More information about the Alsa-devel mailing list