Been testing the A2DP sink example provided with the ESP-IDF, things work alright with the default settings.
I would like to change the frame size of the I2S to 32-bit (so the ESP32 output format is compatible with my hardware), but I'm not sure how to achieve this without causing distortions of the audio. If I just change the 'num_bits' field of the I2S to 32, I get distortion.. which I can understand, as I haven't told the BT sink how to format the data for the I2S (which is now working with a 32bit frame) - but I'm not sure how to achieve this.
I see the callback function (below).. I think, in order to make this work I need to gain access to the code that defines 'data' and 'len'. It seems that I cannot access this code as it is pre-compiled? I would be grateful if someone could chime in with suggestions here.
I don't get how I'm supposed to re-configure this example when I don't have access to all the code. It doesn't seem very flexible at all! I think I must be missing something.
Code: Select all
void bt_app_a2d_data_cb(const uint8_t *data, uint32_t len)
{
size_t bytes_written;
i2s_write(0, data, len, &bytes_written, portMAX_DELAY);
if (++m_pkt_cnt % 100 == 0) {
ESP_LOGI(BT_AV_TAG, "Audio packet count %u", m_pkt_cnt);
}
}
Thanks,
Chris.