You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4238a4e
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: apps/mobile/modules/t3-voice-transcription/android/src/main/java/expo/modules/t3voicetranscription/LivePcmCapture.kt
Copy file name to clipboardExpand all lines: apps/mobile/modules/t3-voice-transcription/android/src/main/java/expo/modules/t3voicetranscription/LiveVoiceRecorder.kt
+11-5Lines changed: 11 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -125,11 +125,17 @@ internal class LiveVoiceRecorder(
125
125
}
126
126
127
127
suspendfunstop() {
128
-
val selection = synchronized(this) { inputSelection }
129
-
selection?.cancel()
130
-
selection?.join()
131
-
capture?.stop()
132
-
if (!inferenceStarted) pipe?.close()
128
+
val recording = capture
129
+
val output = pipe
130
+
try {
131
+
val selection = synchronized(this) { inputSelection }
132
+
selection?.cancel()
133
+
selection?.join()
134
+
recording?.stop()
135
+
} finally {
136
+
// Recognition can start after Stop and still needs the captured PCM pipe.
Copy file name to clipboardExpand all lines: apps/mobile/modules/t3-voice-transcription/android/src/test/java/expo/modules/t3voicetranscription/LiveVoiceRecorderTest.kt
0 commit comments