From 695a46f7068565e7a64dbfd18da1b6900aa4f1aa Mon Sep 17 00:00:00 2001 From: crc-32 Date: Wed, 13 Nov 2024 03:18:41 +0000 Subject: [PATCH] enable dictation formatting (punctuation etc.) --- .../voice/speechrecognizer/SpeechRecognizerDictationService.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/android/shared/src/androidMain/kotlin/io/rebble/cobble/shared/domain/voice/speechrecognizer/SpeechRecognizerDictationService.kt b/android/shared/src/androidMain/kotlin/io/rebble/cobble/shared/domain/voice/speechrecognizer/SpeechRecognizerDictationService.kt index 298bf08a..0d01d673 100644 --- a/android/shared/src/androidMain/kotlin/io/rebble/cobble/shared/domain/voice/speechrecognizer/SpeechRecognizerDictationService.kt +++ b/android/shared/src/androidMain/kotlin/io/rebble/cobble/shared/domain/voice/speechrecognizer/SpeechRecognizerDictationService.kt @@ -49,6 +49,7 @@ class SpeechRecognizerDictationService: DictationService, KoinComponent { private val AUDIO_LATENCY = 600.milliseconds fun buildRecognizerIntent(audioSource: ParcelFileDescriptor? = null, encoding: Int = AudioFormat.ENCODING_PCM_16BIT, sampleRate: Int = 16000, language: String? = null) = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH).apply { putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM) + putExtra(RecognizerIntent.EXTRA_ENABLE_FORMATTING, RecognizerIntent.FORMATTING_OPTIMIZE_QUALITY) audioSource?.let { putExtra(RecognizerIntent.EXTRA_AUDIO_SOURCE, audioSource) putExtra(RecognizerIntent.EXTRA_AUDIO_SOURCE_ENCODING, encoding)