nrfxlib API 2.8.99
Loading...
Searching...
No Matches

◆ sw_codec_lc3_enc_run()

int sw_codec_lc3_enc_run ( void const *const pcm_data,
uint32_t pcm_data_size,
uint32_t enc_bitrate,
uint8_t audio_ch,
uint16_t lc3_data_buf_size,
uint8_t *const lc3_data,
uint16_t *const lc3_data_wr_size )

#include <lc3/include/sw_codec_lc3.h>

Runs the LC3 encoder.

Parameters
[in]pcm_dataBuffer containing PCM data
[in]pcm_data_sizeNumber of bytes in pcm_data. Note that pcm_data is uint16_t *.
[in]enc_bitrateBitrate of encoded mono stream (bps). If set to LC3_USE_BITRATE_FROM_INIT the bitrate given to sw_codec_lc3_enc_init() will be used. Consult the LC3 doc for legal values.
[in]audio_chIndex to which channel is being encoded
[in]lc3_data_buf_sizeSize of supplied LC3 buffer.
[out]lc3_dataPointer to LC3 data output buffer.
[out]lc3_data_wr_sizeNumber of bytes written to lc3_data.
Note
The return codes from Zephyr and LC3 may overlap.
Returns
0 on success. -EPERM Encoder is not initialized. -EINVAL Too few PCM bytes given to encode. Other errors. Refer to LC3 documentation.