Skip to content

Commit

Permalink
enable dictation formatting (punctuation etc.)
Browse files Browse the repository at this point in the history
  • Loading branch information
crc-32 committed Nov 13, 2024
1 parent c76445d commit 695a46f
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 695a46f

Please sign in to comment.