sampleNearest

fun sampleNearest(hostTimeNs: Long = hostClockNs()): Long?

The device sample whose sampleHostTimeNs is nearest hostTimeNs (System.nanoTime()) — the sample a marker made at that moment belongs to, when the marker should sit on the sample closest in time rather than on the one being converted (sampleIndexAt, which is early by up to a sample against it). Numbered as the device counts (unsigned 32-bit, wrapping at 2^32), never negative.

Null under the conditions of sampleHostTimeNs: no stream, impedance mode, or no valid device-clock fit. There is no packet-timing fallback.