[][src]Function aaudio_sys::AAudioStream_setBufferSizeInFrames

pub unsafe extern "C" fn AAudioStream_setBufferSizeInFrames(
    stream: *mut AAudioStream,
    num_frames: i32
) -> i32

This can be used to adjust the latency of the buffer by changing the threshold where blocking will occur. By combining this with AAudioStream_getXRunCount(), the latency can be tuned at run-time for each device. Returns actual buffer size in frames or a negative error.

This cannot be set higher than AAudioStream_getBufferCapacityInFrames().

Note that you will probably not get the exact size you request. You can check the return value or call AAudioStream_getBufferSizeInFrames() to see what the actual final size is.

Available since API level 26.

Arguments

  • stream - reference provided by AAudioStreamBuilder_openStream()
  • num_frames - requested number of frames that can be filled without blocking