Closed theprashant-one closed 2 months ago
Hey @theprashant-one, good spotting! I hadn't yet implemented triggerModelDownload
for Android 13 as it wasn't possible to listen for the status of the download in the SDK. As one temporary measure, the promise for androidTriggerOfflineModelDownload
will have to instantly resolve, however you won't be able to know when the user has downloaded the model or if it failed.
I've just published a release at v0.2.13 which should alllow Android 13 devices to open the model download dialog, however there's a few slight differences, as indicated here:
ExpoSpeechRecognitionModule.androidTriggerOfflineModelDownload({
locale: props.locale,
})
.then((result) => {
if (result.status === "opened_dialog") {
// On Android 13, the status will be "opened_dialog" indicating that the model download dialog was opened.
Alert.alert("Offline model download dialog opened.");
} else if (result.status === "download_success") {
// On Android 14+, the status will be "download_success" indicating that the model download was successful.
Alert.alert("Offline model downloaded successfully!");
}
})
.catch((err) => {
Alert.alert("Failed to download offline model!", err.message);
})
hi @jamsch thanks for quick reponse. I will try this solution and let you know.
One interesting thing I found is that I've downloaded several language packages, as you can see below, but the installed locales remain 'en-US'. Any guidance here?
{"installedLocales": ["en-US"], "locales": ["cmn-Hans-CN", "cmn-Hant-TW", "de-AT", "de-BE", "de-CH", "de-DE", "en-AU", "en-CA", "en-GB", "en-IE", "en-IN", "en-SG", "en-US", "es-ES", "es-US", "fr-BE", "fr-CA", "fr-CH", "fr-FR", "hi-IN", "id-ID", "it-CH", "it-IT", "ko-KR", "pl-PL", "pt-BR", "ru-RU", "th-TH", "tr-TR", "vi-VN"]}
this screenshot is from live transcribe settings menu (app from google)
@theprashant-one The language models actually are installed under the Android System Intelligence app by default ("com.google.android.as"). On Samsung devices you can find the list of installed locales at: Settings -> Security and Privacy -> More privacy settings -> Android System Intelligence -> On-device speech recognition
A bunch of menus to go through, I also got a bit mixed up because there were two Google apps that had options to download offline voice models too.
https://github.com/user-attachments/assets/f24396dc-1e3c-4f69-b952-ded19fedb4f5
@jamsch, I can now see the downloaded locale. Thanks again!
Sweet, closing this issue
Hi, thank you for this awesome package!
my issue is that triggering model download failling (am on android 13)
sample code: