Skip to content

Commit cb859bb

Browse files
committed
bt_av: split the audio data into 512 bytes before sending it to the buffer
1 parent c858982 commit cb859bb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

main/src/user/bt_av.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ void bt_app_a2d_cb(esp_a2d_cb_event_t event, esp_a2d_cb_param_t *param)
7171
void bt_app_a2d_data_cb(const uint8_t *data, uint32_t len)
7272
{
7373
if (audio_buff) {
74-
xRingbufferSend(audio_buff, (void *)data, len, portMAX_DELAY);
74+
for (uint32_t i=0; i<len; i+=512) {
75+
xRingbufferSend(audio_buff, (void *)(data + i), 512, portMAX_DELAY);
76+
}
7577
}
7678
}
7779

0 commit comments

Comments
 (0)