Group PJMED_LYRA
- group PJMED_LYRA
Implementation of lyra Codec.
This section describes functions to initialize and register lyra codec factory to the codec manager. After the codec factory has been registered, application can use Codec Framework API to manipulate the codec.
Lyra codec supports 16-bit PCM audio signal with sampling rate of (8000Hz, 16000Hz, 32000Hz and 48000Hz), frame length 20ms, and resulting in bitrate 3200bps, 6000bps and 9200bps.
Functions
-
pj_status_t pjmedia_codec_lyra_init(pjmedia_endpt *endpt)
Initialize and register lyra codec factory to pjmedia endpoint.
- Parameters:
endpt – The pjmedia endpoint.
- Returns:
PJ_SUCCESS on success.
-
pj_status_t pjmedia_codec_lyra_deinit(void)
Unregister lyra codec factory from pjmedia endpoint and deinitialize the lyra codec library.
- Returns:
PJ_SUCCESS on success.
-
pj_status_t pjmedia_codec_lyra_get_config(pjmedia_codec_lyra_config *cfg)
Get the default Lyra configuration.
- Parameters:
cfg – Lyra codec configuration.
- Returns:
PJ_SUCCESS on success.
-
pj_status_t pjmedia_codec_lyra_set_config(const pjmedia_codec_lyra_config *cfg)
Set the default Lyra configuration.
- Parameters:
cfg – Lyra codec configuration.
- Returns:
PJ_SUCCESS on success.
-
struct pjmedia_codec_lyra_config
- #include <lyra.h>
Lyra codec setting;
Public Members
-
unsigned bit_rate
The value represents the decoder bitrate requested by the receiver. Endpoints can be configured with different bitrates. For example, the local endpoint might be set to a bitrate of 3200, while the remote endpoint is set to 6000. In this scenario, the remote endpoint will send data at 3200 bitrate, while the local endpoint will send data at 6000 bitrate. Valid bitrate: 3200, 6000, 9200. By default it is set to PJMEDIA_CODEC_LYRA_DEFAULT_BIT_RATE.
-
pj_str_t model_path
Lyra required some additional (model) files, including lyra_config.binarypb , lyragan.tflite , quantizer.tflite and soundstream_encoder.tflite . This setting represents the folder containing the above files. The specified folder should contain these files. If an invalid folder is provided, the codec creation will fail.
-
unsigned bit_rate
-
pj_status_t pjmedia_codec_lyra_init(pjmedia_endpt *endpt)