-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use InitModel(model) if we DOWNLOAD VOSK MODELS FROM INSIDE APP CODE? #190
Comments
https://note.com/srvhat09/n/n0010ab66ee41 |
In general you don't need UUID. You can check https://github.com/alphacep/vosk-android-service/tree/master/app/src/main/java/org/vosk/service/download, it simply downloads models from our server |
I'm confused about StorageService.unpack(context, SourcePath, targetPath, completeCallback, errorCallback) function
from this demo as far as I understand that sourcePath "model-en-us" is refferring to FOLDER NAME IN ASSET IN PC HARDDISK (C:\Users\Toshiba\AndroidStudioProjects\vosk-android-demo\model\src\main\assets\model-en-us) My question is HOW TO USE THIS StorageService.unpack(this, "model-en-us", "model", completeCallback, errorCallback) if I downloaded a French-model.zip from MainActivity USING SOME CODES (NOT MANUALLY DOWNLOAD IT THEN PUT IT IN ASSETS FOLDER) then extract it into /storage/emulated/0/Android/data/MyAppName/files/extracted/model-fr-FR I've tried using this string_model = "/storage/emulated/0/Android/data/MyAppName/files/extracted/model-fr-FR
BUT IT GAVE ME ERRORS Here's my source code but I've deleted the content of "en-US" folder because it's to big to upload here. so, in case you want to try it you have to copy the content of "model-en-us" from this vosk demo to "en-US" of my source code. I'm using that initModel(String string_model) function in VoskVoiceRecognizer.java class. DO YOU MEAN THAT I DON'T NEED TO USE THAT initModel(model) FUNCTION? JUST DOWNLOAD AND UNZIP TO /Android/data/MyAppName/files/model/fr-FR ? I've tried that, check my zipped attachment It gave me error 2022-10-05 02:16:06.475 15304-15304/org.vosk.livesubtitle A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x5a4 in tid 15304 (sk.livesubtitle), pid 15304 (sk.livesubtitle) |
this is just a MANUAL DOWNLOAD NOT DOWNLOAD BY USING CODES FROM INSIDE MainActivity.java My problem is HOW TO USE that StorageService.unpack(Context context, String sourcePath, final String targetPath, final Callback completeCallback, final Callback errorCallback) function in initModel(model) that sourcePath, how to use it? |
oh man.. Model model = new Model("/storage/emulated/0/Android/data/MyAppName/files/extracted_downloded_models/model-fr-FR") but thanks anyway to TRIGGER me to find it :) |
I'm trying to add another language model by DOWNLOADING MODELS FROM INSIDE APP CODE
How to use initModel(String model) after downloaded it to local storage?
From my MainActivity.java I downloaded a model from VOSK Models website then extracted that model.zip into /storage/emulated/0/Android/data/MyAppName/files/model).
So, what's next should I do?
Do I need to create UUID?
How to create its UUID from app code (NOT FROM gradle)?
Can you please give some java codes example how to do that?
The text was updated successfully, but these errors were encountered: