mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 06:25:44 +01:00
speaker-test: Support S24_3LE sample format
Implement support signed 24 bit samples, packed in 3 bytes. Signed-off-by: Julian Scheel <julian@jusst.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
da4d5bd53a
commit
0e2703cef9
1 changed files with 14 additions and 0 deletions
|
@ -283,6 +283,8 @@ static const int supported_formats[] = {
|
||||||
SND_PCM_FORMAT_S16_LE,
|
SND_PCM_FORMAT_S16_LE,
|
||||||
SND_PCM_FORMAT_S16_BE,
|
SND_PCM_FORMAT_S16_BE,
|
||||||
SND_PCM_FORMAT_FLOAT_LE,
|
SND_PCM_FORMAT_FLOAT_LE,
|
||||||
|
SND_PCM_FORMAT_S24_3LE,
|
||||||
|
SND_PCM_FORMAT_S24_3BE,
|
||||||
SND_PCM_FORMAT_S32_LE,
|
SND_PCM_FORMAT_S32_LE,
|
||||||
SND_PCM_FORMAT_S32_BE,
|
SND_PCM_FORMAT_S32_BE,
|
||||||
-1
|
-1
|
||||||
|
@ -325,6 +327,18 @@ static void do_generate(uint8_t *frames, int channel, int count,
|
||||||
case SND_PCM_FORMAT_FLOAT_LE:
|
case SND_PCM_FORMAT_FLOAT_LE:
|
||||||
*samp_f++ = res.f;
|
*samp_f++ = res.f;
|
||||||
break;
|
break;
|
||||||
|
case SND_PCM_FORMAT_S24_3LE:
|
||||||
|
res.i >>= 8;
|
||||||
|
*samp8++ = LE_INT(res.i);
|
||||||
|
*samp8++ = LE_INT(res.i) >> 8;
|
||||||
|
*samp8++ = LE_INT(res.i) >> 16;
|
||||||
|
break;
|
||||||
|
case SND_PCM_FORMAT_S24_3BE:
|
||||||
|
res.i >>= 8;
|
||||||
|
*samp8++ = BE_INT(res.i);
|
||||||
|
*samp8++ = BE_INT(res.i) >> 8;
|
||||||
|
*samp8++ = BE_INT(res.i) >> 16;
|
||||||
|
break;
|
||||||
case SND_PCM_FORMAT_S32_LE:
|
case SND_PCM_FORMAT_S32_LE:
|
||||||
*samp32++ = LE_INT(res.i);
|
*samp32++ = LE_INT(res.i);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue