[][src]Type Definition aaudio_sys::ErrorCallback

type ErrorCallback = Option<unsafe extern "C" fn(stream: *mut AAudioStream, user_data: *mut c_void, error: i32)>;

Prototype for the callback function that is passed to AAudioStreamBuilder_setErrorCallback().

The following may NOT be called from the error callback:

  • AAudioStream_requestStop()
  • AAudioStream_requestPause()
  • AAudioStream_close()
  • AAudioStream_waitForStateChange()
  • AAudioStream_read()
  • AAudioStream_write()

The following are OK to call from the error callback:

  • AAudioStream_get*()

  • AAudio_convertResultToText()

  • stream - reference provided by AAudioStreamBuilder_openStream()

  • user_data - the same address that was passed to AAudioStreamBuilder_setErrorCallback()

  • error - an AAUDIO_ERROR_* value.