[][src]Function aaudio_sys::AAudioStreamBuilder_setDataCallback

pub unsafe extern "C" fn AAudioStreamBuilder_setDataCallback(
    builder: *mut AAudioStreamBuilder,
    callback: DataCallback,
    user_data: *mut c_void
)

Request that AAudio call this functions when the stream is running.

Note that when using this callback, the audio data will be passed in or out of the function as an argument. So you cannot call AAudioStream_write() or AAudioStream_read() on the same stream that has an active data callback.

The callback function will start being called after AAudioStream_requestStart() is called. It will stop being called after AAudioStream_requestPause() or AAudioStream_requestStop() is called.

This callback function will be called on a real-time thread owned by AAudio. See DataCallback for more information.

Note that the AAudio callbacks will never be called simultaneously from multiple threads.

Available since API level 26.

  • builder - reference provided by AAudio_createStreamBuilder()
  • callback - pointer to a function that will process audio data.
  • user_data - pointer to an application data structure that will be passed to the callback functions.