Read the Docs Template Documentation, Release
•
el
: The audio element handle
•
buffer
: The buffer pointer
•
wanted_size
: The wanted size
audio_element_output
el
, char *
buffer
, int
write_size
)
Call this function to sendout Element output data.
Return
• > 0 number of bytes written
• <=0 audio_element_err_t
Parameters
•
el
: Depend on setup using ringbuffer or function callback, Element will invokes write t ringbuffer,
or call write callback funtion
•
buffer
: The buffer pointer
•
write_size
: The write size
esp_err_t
audio_element_set_read_cb
el
,
fn
, void *
context
)
This API allows the application to set a read callback for the first audio_element in the pipeline for allowing the
pipeline to interface with other systems. The callback is invoked every time the audio element requires data to
be processed.
Return
• ESP_OK
• ESP_FAIL
Parameters
•
el
: The audio element handle
•
fn
: Callback read function. The callback function should return number of bytes read or -1 in case
of error in reading. Note that the callback function may decide to block and that may block the entire
pipeline.
•
context
: An optional context which will be passed to callback function on every invocation
esp_err_t
audio_element_set_write_cb
el
,
fn
, void *
context
)
This API allows the application to set a write callback for the last audio_element in the pipeline for allowing the
pipeline to interface with other systems. The callback is invoked every time the audio element has a processed
data that needs to be passed forward.
Return
• ESP_OK
• ESP_FAIL
Parameters
•
el
: The audio element
•
fn
: Callback write function. The callback function should return number of bytes written or -1 in
case of error in writing. Note that the callback function may decide to block and that may block the
entire pipeline.
36
Chapter 2. API Reference
Summary of Contents for ESP32-LyraT
Page 1: ...Read the Docs Template Documentation Release Read the Docs Jul 01 2018...
Page 2: ......
Page 4: ...ii...
Page 6: ...Read the Docs Template Documentation Release 2 Contents...
Page 92: ...Read the Docs Template Documentation Release 88 Chapter 4 Resources...
Page 94: ...Read the Docs Template Documentation Release 90 Chapter 5 Copyrights and Licenses...