Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PitchDetectionHandler { result, audioEvent ->
val pitchInHz = result.pitch.toDouble()
if (shouldUpdateTunerState(pitchInHz, audioEvent)) {
val capturedNoteState = getCurrentPitchState(pitchInHz)
_tunerState.postValue(capturedNoteState)
saveLastUpdatedTime()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment