ErrorCallback

Type Alias ErrorCallback 

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

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.

Aliased Type§

pub enum ErrorCallback {
    None,
    Some(unsafe extern "C" fn(*mut AAudioStream, *mut c_void, i32)),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(*mut AAudioStream, *mut c_void, i32))

Some value of type T.