csdcorp / speech_to_text

A Flutter plugin that exposes device specific text to speech recognition capability.
BSD 3-Clause "New" or "Revised" License
372 stars 231 forks source link

Map ListenMode.search to LANGUAGE_MODEL_WEB_SEARCH language model in Android #557

Open vongrad opened 1 day ago

vongrad commented 1 day ago

Android speech recognition has an issue with recognizing short (1-3 letter) words as stated per: https://issuetracker.google.com/issues/280288200.

It appears that Google has finally fixed/improved this by setting EXTRA_LANGUAGE_MODEL=LANGUAGE_MODEL_WEB_SEARCH I propose that we could hook this functionality to the ListenMode.search for Android that is already supported by iOS and maps to SFSpeechRecognitionTaskHint.search.

vongrad commented 10 hours ago

I believe the listenMode did not have any functionality previously except being assigned to a value. I left the default behavior exactly the same except if the ListenMode.search is set, we use EXTRA_LANGUAGE_MODEL=LANGUAGE_MODEL_WEB_SEARCH.