A voice recognition demo for Android.
- based on vosk-android-demo
- support Chinese voice recognition with microphone as audio data source
- by change model file, you can easily change target language
- code is simplified and more readable
- future work:
- train my own voice recognition model in the future and share the whole procedure
- go to
vosk/src/main/assets/
folder - download model zip file from official model list (my choice is
vosk-model-small-cn-0.3
) - unzip the model zip file to
vosk/src/main/assets/
and change the result folder name fromvosk-model-small-cn-0.3
tomodel-zh-cn
- accordingly, you should also change
vosk/build.gradle
line 23 todef odir = file("$buildDir/generated/assets/model-zh-cn")
, and changeapp/src/main/java/com/dfanr/voskvoicerecgnition/MainActivity.java
line 186(in function initModel()) toStorageService.unpack(this, "model-zh-cn", "model", ...)
- finally the app is supposed to run with no problem.