From a7b5cba5523684dd009b5f5b4c0507d7988ddac8 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 7 Mar 2023 16:26:02 +0100 Subject: [PATCH] btstack_lc3_google: support 44.1 kHz --- src/btstack_lc3_google.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/btstack_lc3_google.c b/src/btstack_lc3_google.c index e88591257..43a26bbff 100644 --- a/src/btstack_lc3_google.c +++ b/src/btstack_lc3_google.c @@ -69,6 +69,11 @@ static uint8_t lc3_decoder_google_configure(void * context, uint32_t sample_rate instance->frame_duration = frame_duration; instance->octets_per_frame = octets_per_frame; + // map 44.1 to 48 + if (sample_rate == 44100){ + sample_rate = 48000; + } + // config decoder instance->decoder = lc3_setup_decoder(duration_us, sample_rate, 0, &instance->decoder_mem); @@ -140,6 +145,11 @@ static uint8_t lc3_encoder_google_configure(void * context, uint32_t sample_rate instance->frame_duration = frame_duration; instance->octets_per_frame = octets_per_frame; + // map 44.1 to 48 + if (sample_rate == 44100){ + sample_rate = 48000; + } + // config encoder instance->encoder = lc3_setup_encoder(duration_us, sample_rate, 0, &instance->encoder_mem);