Closed Stypox closed 1 year ago
Is there an example of starting this activity using am
? I've tried many variations of the following, but to no avail:
$ am start -a RecognizerIntent.ACTION_RECOGNIZE_SPEECH -e RecognizerIntent.EXTRA_PROMPT test
Starting: Intent { act=RecognizerIntent.ACTION_RECOGNIZE_SPEECH (has extras) }
Error: Activity not started, unable to resolve Intent { act=RecognizerIntent.ACTION_RECOGNIZE_SPEECH flg=0x10000000 (has extras) }
@sudomain, that's best asked at https://github.com/Stypox/dicio-android/discussions/new?category=q-a
@sudomain I have no experience with am, but guessing from Error: Activity not started, unable to resolve Intent { act=RecognizerIntent.ACTION_RECOGNIZE_SPEECH flg=0x10000000 (has extras) }
: May you have to use directly the string "android.speech.action.RECOGNIZE_SPEECH" (like in the activity's manifest definition)? This is the actual value of RecognizerIntent.ACTION_RECOGNIZE_SPEECH
Speech to text service
This PR implements a Speech To Text service available to apps, fixing #54. Here is a preview of the feature, after pressing on the microphone button in Google Maps:
It is possible to also open the service from Dicio's navigation drawer, allowing the user to take dictation, copy to clipboard and share, fixing #33.
Testing APK
app-debug.zip
Technical details
This PR supersedes #100 by @nebkrid. #100 implemented the service as a skill, while this PR implements it as its own activity. The research done in #100 was really helpful though! I also kept the TODOs left behind there for later: for example, the result intent from the activity might contain multiple speech interpretations each with some different accuracy, and while Vosk does provide such information, it is currently not added to the result intent for simplicity.
This PR includes #111, thanks to @nebkrid again :-)
This PR also fixes a random crash when cleaning up Vosk, and sets the theme color used in e.g. button texts to a sensible value.