AMR Decoder and Encoder

Decode and encode an audio data stream from / to AMR format. Encoders cover both AMRNB and AMRWB formats.

Application Examples

Implementation of this API is demonstrated in the following examples:

API Reference - Decoder

Functions

audio_element_handle_t amr_decoder_init(amr_decoder_cfg_t *config)

Create an Audio Element handle to decode incoming AMR data.

Return
The audio element handle
Parameters
  • config: The configuration

Structures

struct amr_decoder_cfg_t

AMR Decoder configuration.

Public Members

int out_rb_size

Size of output ringbuffer

int task_stack

Task stack size

int task_core

CPU core number (0 or 1) where decoder task in running

int task_prio

Task priority (based on freeRTOS priority)

Macros

AMR_DECODER_TASK_STACK_SIZE
AMR_DECODER_TASK_CORE
AMR_DECODER_TASK_PRIO
AMR_DECODER_RINGBUFFER_SIZE
DEFAULT_AMR_DECODER_CONFIG

API Reference - AMRNB Encoder

Functions

audio_element_handle_t amrnb_encoder_init(amrnb_encoder_cfg_t *config)

Create an Audio Element handle to encode incoming AMRNB data.

Return
The audio element handle
Parameters
  • config: The configuration

Structures

struct amrnb_encoder_cfg_t

AMRNB Encoder configurations.

Public Members

int out_rb_size

Size of output ringbuffer

int task_stack

Task stack size

int task_core

Task running in core (0 or 1)

int task_prio

Task priority (based on freeRTOS priority)

Macros

AMRNB_ENCODER_TASK_STACK
AMRNB_ENCODER_TASK_CORE
AMRNB_ENCODER_TASK_PRIO
AMRNB_ENCODER_RINGBUFFER_SIZE
DEFAULT_AMRNB_ENCODER_CONFIG

API Reference - AMRWB Encoder

Functions

audio_element_handle_t amrwb_encoder_init(amrwb_encoder_cfg_t *config)

Create an Audio Element handle to encode incoming amrwb data.

Return
The audio element handle
Parameters
  • config: The configuration

Structures

struct amrwb_encoder_cfg_t

AMRWB Encoder configurations.

Public Members

int out_rb_size

Size of output ringbuffer

int task_stack

Task stack size

int task_core

Task running in core (0 or 1)

int task_prio

Task priority (based on freeRTOS priority)

Macros

AMRWB_ENCODER_TASK_STACK
AMRWB_ENCODER_TASK_CORE
AMRWB_ENCODER_TASK_PRIO
AMRWB_ENCODER_RINGBUFFER_SIZE
DEFAULT_AMRWB_ENCODER_CONFIG