biemster / gasr

Google Chrome SODA Offline Speech Recognition command line client
https://hackaday.io/project/164399-android-offline-speech-recognition-natively-on-pc
145 stars 17 forks source link

Where can i find french model or other languages? #14

Closed goddade closed 1 year ago

biemster commented 1 year ago

The file constants.h in the chromium source contains the crx ids of the language packs, which you can convert to ascii using this bit of python:

h = [0x6e, 0x0e, ... rest of the fr-FR hex]
crxid = ''
for c in h[:32]:
    crxid += chr(c + ord('a'))
print(crxid)

This id is what you need to download the crx3 extension using a tool like https://robwu.nl/crxviewer/

goddade commented 1 year ago

The file constants.h in the chromium source contains the crx ids of the language packs, which you can convert to ascii using this bit of python:

h = [0x6, 0xe, 0x0, 0xe, ... rest of the fr-FR hex as single chars]
crxid = ''
for c in h[:32]:
    crxid += chr(c + ord('a'))
print(crxid)

This id is what you need to download the crx3 extension using a tool like https://robwu.nl/crxviewer/

Thank you!

goddade commented 1 year ago

I get a non-ascii string: ÏoŒĴħņ|¿śŐ£ ¸ĚŒt·¨¹ļ×êÒŌ€Ŏ©ÍčĶ’ā

biemster commented 1 year ago

hm yeah I forgot, the hex characters have to be single, so instead of h = [0x6e, 0x0e, ...] what I wrote earlier, it should be h = [0x6, 0xe, 0x0, 0xe, ...]

goddade commented 1 year ago
...
for c in h[:16]:
    crxid += chr(((c>>4)&0x0f) +ord('a'))
    crxid += chr((c&0x0f) +ord('a'))
...
biemster commented 1 year ago

or that :smile:

dlxj commented 1 month ago

Could anyone tell me if it's still possible to download the language model using this method? I tried, but it showed a 404 error and couldn't be downloaded.

biemster commented 1 month ago

This method should still work. Also, I'm almost finished with the chromeos version of SODA after which all the models mentioned here can be used: https://chromium.googlesource.com/chromium/src.git/+/refs/heads/main/components/soda/soda_installer_impl_chromeos.cc

Those are available on simpler links like https://edgedl.me.gvt1.com/edgedl/dlc/hatch-release/R128-15955.0.0/dlc-scaled/libsoda-model-fr-fr-cnch24d1/package/dlc.img

goddade commented 1 month ago

Select the language in chrome, and then the model is in ~/.config/google-chrome/SODALanguages/

goddade commented 1 month ago

Select the language in chrome, and then the model is in ~/.config/google-chrome/SODALanguages/

chrome://settings/captions, Add languages