ESP32 HFP AG CVSD data format

LiborT
Posts: 1
Joined: Thu May 06, 2021 7:22 am

ESP32 HFP AG CVSD data format

Postby LiborT » Thu May 06, 2021 7:45 am

Hi ESP32 community,
I'm trying to understand and modify the HFP AG example for an open-source digital radio amateur transceiver.

What is the format of the data I shall return in the

Code: Select all

static uint32_t bt_app_hf_outgoing_cb(uint8_t *p_buf, uint32_t channel_len)
function? I'm using CVSD (disabled wideband mSBC in menuconfig).
the channel_len is 120, what 120 bytes? words? oranges? Signed or unsigned?

CVSD shall be 64kbit/s -> 8kHz * 8 bits mono, but the example is using int16_t? I'm getting some sound from BT headset, but it's far from sinus. Does it even accept raw audio data? Or does it need to be encoded with some vocoder?

I think it shall be in big-endian int16_t {LSB, MSB, LSB, MSB...} however when I'm packing 2xChannel_len bytes the app crashes.

TNX

Update:
Ok by test&crash I've found it's big-endian int16_t sound indeed, channel_len is byte count. For my HW, it's always 120, also 60 samples also 7.5ms voice per call. It would be nice having it properly documented.

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 94 guests