From 0beba027e7e5ec48b144a5e6925025bc0e381ab3 Mon Sep 17 00:00:00 2001 From: shipei Date: Tue, 29 Aug 2023 15:14:11 +0800 Subject: [PATCH] audio:add 24K sample rate support Signed-off-by: shipei --- arch/sim/src/sim/posix/sim_alsa.c | 1 + include/nuttx/audio/audio.h | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/arch/sim/src/sim/posix/sim_alsa.c b/arch/sim/src/sim/posix/sim_alsa.c index a7c7450d409c3..d488e37baf338 100644 --- a/arch/sim/src/sim/posix/sim_alsa.c +++ b/arch/sim/src/sim/posix/sim_alsa.c @@ -361,6 +361,7 @@ static int sim_audio_getcaps(struct audio_lowerhalf_s *dev, int type, AUDIO_SAMP_RATE_11K | AUDIO_SAMP_RATE_16K | AUDIO_SAMP_RATE_22K | + AUDIO_SAMP_RATE_24K | AUDIO_SAMP_RATE_32K | AUDIO_SAMP_RATE_44K | AUDIO_SAMP_RATE_48K; diff --git a/include/nuttx/audio/audio.h b/include/nuttx/audio/audio.h index da9c55f1e2059..225b7f9a09977 100644 --- a/include/nuttx/audio/audio.h +++ b/include/nuttx/audio/audio.h @@ -212,18 +212,20 @@ #define AUDIO_SAMP_RATE_11K 0x0002 #define AUDIO_SAMP_RATE_16K 0x0004 #define AUDIO_SAMP_RATE_22K 0x0008 -#define AUDIO_SAMP_RATE_32K 0x0010 -#define AUDIO_SAMP_RATE_44K 0x0020 -#define AUDIO_SAMP_RATE_48K 0x0040 -#define AUDIO_SAMP_RATE_88K 0x0080 -#define AUDIO_SAMP_RATE_96K 0x0100 -#define AUDIO_SAMP_RATE_128K 0x0200 -#define AUDIO_SAMP_RATE_160K 0x0400 -#define AUDIO_SAMP_RATE_172K 0x0800 -#define AUDIO_SAMP_RATE_192K 0x1000 +#define AUDIO_SAMP_RATE_24K 0x0010 +#define AUDIO_SAMP_RATE_32K 0x0020 +#define AUDIO_SAMP_RATE_44K 0x0040 +#define AUDIO_SAMP_RATE_48K 0x0080 +#define AUDIO_SAMP_RATE_88K 0x0100 +#define AUDIO_SAMP_RATE_96K 0x0200 +#define AUDIO_SAMP_RATE_128K 0x0400 +#define AUDIO_SAMP_RATE_160K 0x0800 +#define AUDIO_SAMP_RATE_172K 0x1000 +#define AUDIO_SAMP_RATE_192K 0x2000 #define AUDIO_SAMP_RATE_DEF_ALL (AUDIO_SAMP_RATE_8K | AUDIO_SAMP_RATE_11K | \ AUDIO_SAMP_RATE_16K | AUDIO_SAMP_RATE_22K | \ - AUDIO_SAMP_RATE_32K | AUDIO_SAMP_RATE_44K | \ + AUDIO_SAMP_RATE_24K | AUDIO_SAMP_RATE_32K | \ + AUDIO_SAMP_RATE_44K | AUDIO_SAMP_RATE_48K | \ AUDIO_SAMP_RATE_88K | AUDIO_SAMP_RATE_96K | \ AUDIO_SAMP_RATE_128K | AUDIO_SAMP_RATE_160K | \ AUDIO_SAMP_RATE_172K | AUDIO_SAMP_RATE_192K )