Skip to content

Instantly share code, notes, and snippets.

@arildojr7
Last active November 26, 2021 03:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arildojr7/16fe673301a871ca76993214656f8bc9 to your computer and use it in GitHub Desktop.
Save arildojr7/16fe673301a871ca76993214656f8bc9 to your computer and use it in GitHub Desktop.
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