openWithRing
abstract suspend fun openWithRing(request: AudioFormat, capacityFrames: (AudioFormat) -> Int): NativeRingHandoff
Opens the device and the ring behind it together, and hands back both.
The order inside is fixed by a real dependency: the ring's format is the format the device accepted, and its capacity is computed from that format plus the device's own period, so the device has to be negotiated before the ring can exist. That is why the capacity arrives as a function rather than as a number, and why the policy behind that function stays in the engine.
Return
the accepted format and the ring the feeder must write into. The ring is owned by this sink; see the class note.
Parameters
request
what the engine would like. What it gets may differ, which is why the format comes back in the result.
capacityFrames
how many sample frames to hold, given the format the device accepted.