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)

bool stack_in_ext

Try to allocate stack in external memory

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)

bool contain_amrnb_header

Choose to contain amrnb header in amrnb encoder whether or not (true or false, true means choose to contain amrnb header)

bool stack_in_ext

Try to allocate stack in external memory

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)

bool contain_amrwb_header

Choose to contain amrwb header in amrwb encoder whether or not (true or false, true means choose to contain amrwb header)

bool stack_in_ext

Try to allocate stack in external memory

Macros

AMRWB_ENCODER_TASK_STACK
AMRWB_ENCODER_TASK_CORE
AMRWB_ENCODER_TASK_PRIO
AMRWB_ENCODER_RINGBUFFER_SIZE
DEFAULT_AMRWB_ENCODER_CONFIG()