nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches
sw_codec_select.h File Reference
#include <zephyr/kernel.h>
#include "channel_assignment.h"

Go to the source code of this file.

Data Structures

struct  sw_codec_encoder
 
struct  sw_codec_decoder
 
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_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_STEREO   (PCM_NUM_BYTES_MONO * 2)
 

Enumerations

enum  sw_codec_select { SW_CODEC_NONE , SW_CODEC_LC3 }
 
enum  sw_codec_channel_mode { SW_CODEC_MONO = 1 , SW_CODEC_STEREO }
 

Functions

bool sw_codec_is_initialized (void)
 Check if the software codec is initialized.
 
int sw_codec_encode (void *pcm_data, size_t pcm_size, uint8_t **encoded_data, size_t *encoded_size)
 Encode PCM data and output encoded data.
 
int sw_codec_decode (uint8_t const *const encoded_data, size_t encoded_size, bool bad_frame, void **pcm_data, size_t *pcm_size)
 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.