Bluetooth LDAC decoding support
There is LDAC decoder library on GitHub: https://github.com/anonymix007/libldacdec
BlueALSA already has support for LDAC sink using this library.
Here's the API description:
int ldacdecInit(ldacdec_t *this);
- initializes the decoder structure
int ldacDecode_type(ldacdec_t *this, uint8_t *stream, void *pcm, int *bytesUsed, LDACBT_SMPL_FMT_T fmt);
- decodes packets to PCM (16/32 bit integers and 32 bit floats are supported)
int ldacdecGetSampleRate(ldacdec_t *this);
- retrieve sample rate of decoded stream
int ldacdecGetChannelCount(ldacdec_t *this);
- retrieve channel count in decoded stream
Sample count may be retrieved via dec.frame.frameSamples
there dec
is declared as follows: ldacdec_t dec;
.