[][src]Function aaudio_sys::AAudioStreamBuilder_setSampleRate

pub unsafe extern "C" fn AAudioStreamBuilder_setSampleRate(
    builder: *mut AAudioStreamBuilder,
    sample_rate: i32
)

Request a sample rate in Hertz.

The default, if you do not call this function, is UNSPECIFIED. An optimal value will then be chosen when the stream is opened. After opening a stream with an unspecified value, the application must query for the actual value, which may vary by device.

If an exact value is specified then an opened stream will use that value. If a stream cannot be opened with the specified value then the open will fail.

Available since API level 26.

Arguments

  • builder - reference provided by AAudio_createStreamBuilder()
  • sample_rate - frames per second. Common rates include 44100 and 48000 Hz.