nrfxlib API 2.7.99
Loading...
Searching...
No Matches

◆ LC3DecodeSessionData()

int32_t LC3DecodeSessionData ( LC3DecoderHandle_t  decodeHandle,
LC3DecodeInput_t decodeInput,
LC3DecodeOutput_t decodeOutput 
)

#include <lc3/codec/inc/LC3API.h>

Decodes a frame of data using LC3.

Processes the frame of encoded bit stream data passed by the decodeInput structure. Returns the decoded audio PCM data via the decodeOutput structure.

This function will automatically apply packet loss concealment (PLC) to any frame where the decode input's badFrameIndicator is set to BadFrame or if the bit stream data contains errors. The caller should set badFrameIndicator to BadFrame if the caller knows in advance of bit stream errors; this allows the decoder to skip decoding and directly apply PLC. If the caller is unaware of bit stream errors, but they are present, the decoder will detect them regardless. When PLC is applied successfully, this function still returns LC3_RESULT_NO_ERROR as when a frame is decoded successfully, but the decode output's PLCCounter parameter is incremented. Upon a successful decode, PLCCounter is reset. Therefore, a non-zero PLCCounter indicates PLC has been applied to the current frame.

Parameters
[in]decodeHandleHandle to a decoder instance.
[in]decodeInputPointer to a structure pointing to the encoded bit stream frame to decode.
[in]decodeOutputPointer to a structure to receive the frame's decoded PCM data.
Returns
Zero on success or one of the defined LC3 result codes on error.