nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches
Audio Software Codec Selection

Software codec selection and configuration API for Audio applications. More...

Data Structures

struct  lc3_encoder_context
 Private encoder context. More...
 
struct  lc3_decoder_context
 Private decoder context. More...
 
struct  sw_codec_encoder
 Software codec encoder configuration structure. More...
 
struct  sw_codec_decoder
 Software codec decoder configuration structure. More...
 
struct  sw_codec_config
 Sw_codec configuration structure. More...
 

Macros

#define LC3_ENC_MONO_FRAME_SIZE   0
 
#define LC3_PCM_NUM_BYTES_MONO   0
 
#define LC3_ENC_TIME_US   0
 
#define LC3_DEC_TIME_US   0
 
#define ENC_MAX_FRAME_SIZE   MAX(LC3_ENC_MONO_FRAME_SIZE, 0)
 
#define ENC_MULTI_CHAN_MAX_FRAME_SIZE   (LC3_ENC_MONO_FRAME_SIZE * CONFIG_AUDIO_ENCODE_CHANNELS_MAX)
 
#define ENC_TIME_US   MAX(LC3_ENC_TIME_US, 0)
 
#define DEC_TIME_US   MAX(LC3_DEC_TIME_US, 0)
 
#define PCM_NUM_BYTES_MONO   MAX(LC3_PCM_NUM_BYTES_MONO, 0)
 
#define PCM_NUM_BYTES_MULTI_CHAN    (PCM_NUM_BYTES_MONO * MAX(CONFIG_AUDIO_DECODE_CHANNELS_MAX, CONFIG_AUDIO_OUTPUT_CHANNELS))
 

Enumerations

enum  sw_codec_select { SW_CODEC_NONE , SW_CODEC_LC3 }
 Software codec selection enumeration. More...
 

Functions

bool sw_codec_is_initialized (void)
 Check if the software codec is initialized.
 
int sw_codec_encode (struct net_buf *audio_frame_in, struct net_buf *audio_frame_out)
 Encode PCM data and output encoded data.
 
int sw_codec_decode (struct net_buf const *const audio_frame_in, struct net_buf *const audio_frame_out)
 Decode encoded data and output PCM data.
 
int sw_codec_uninit (struct sw_codec_config sw_codec_cfg)
 Uninitialize the software codec and free the allocated space.
 
int sw_codec_init (struct sw_codec_config sw_codec_cfg)
 Initialize the software codec and statically or dynamically allocate memory to be used, depending on the selected codec and its configuration.
 

Detailed Description

Software codec selection and configuration API for Audio applications.

This module provides the software codec interface for audio encoding and decoding operations. It supports the LC3 (Low Complexity Communication Codec) as specified in the Bluetooth LE Audio standard. The module handles codec initialization and codec configuration. It provides encoding/decoding functions with support for different sample rates, bitrates, and channel modes (mono/stereo). It integrates with Audio System to process audio data for both unicast (CIS) and broadcast (BIS) streaming modes.