Skip to content

Commit

Permalink
fix(check-pronunciation): transition to 'cleared'
Browse files Browse the repository at this point in the history
If a user recorded audio and did not play it
then the audio was retained when the next card
was shown
  • Loading branch information
david-allison committed Apr 22, 2024
1 parent 3a5cde1 commit 797862b
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -523,11 +523,14 @@ class AudioRecordingController :
fun updateUIForNewCard() {
Timber.i("resetting audio recorder: new card shown")
try {
if (isPlaying) {
discardAudio()
// transition to the 'CLEARED' state
if (state == AppendToRecording.CLEARED) {
return
}
if (isRecording || isRecordingPaused) {
clearRecording()
} else {
discardAudio()
}
} catch (e: Exception) {
Timber.d("Unable to reset the audio recorder", e)
Expand Down

0 comments on commit 797862b

Please sign in to comment.