[][src]Function aaudio_sys::AAudioStreamBuilder_setFramesPerDataCallback

pub unsafe extern "C" fn AAudioStreamBuilder_setFramesPerDataCallback(
    builder: *mut AAudioStreamBuilder,
    num_frames: i32
)

Set the requested data callback buffer size in frames. See DataCallback.

The default, if you do not call this function, is Unspecified.

For the lowest possible latency, do not call this function. AAudio will then call the dataProc callback function with whatever size is optimal. That size may vary from one callback to another.

Only use this function if the application requires a specific number of frames for processing. The application might, for example, be using an FFT that requires a specific power-of-two sized buffer.

AAudio may need to add additional buffering in order to adapt between the internal buffer size and the requested buffer size.

If you do call this function then the requested size should be less than half the buffer capacity, to allow double buffering.

Available since API level 26.

  • builder - reference provided by AAudio_createStreamBuilder()
  • num_frames - the desired buffer size in frames or Unspecified