onBeat

fun onBeat(callback: (beatIndex: Int) -> Unit): SonixMetronome.Builder

Called on each beat.

Useful for UI synchronization, haptic feedback, or LED indicators.

Return

This builder for chaining

Parameters

callback

Receives the 0-based beat index