Android Question VOSK English GB model?

JohnC

Expert
Licensed User
Longtime User
If you can't find a British English voice, this routine might help a little using the american voice:

B4X:
Sub ConvertToBritish(americanText As String) As String
    Dim britishText As String = americanText
    
    britishText = britishText.Replace("apartment", "flat")
    britishText = britishText.Replace("elevator", "lift")
    britishText = britishText.Replace("trash", "rubbish")
    britishText = britishText.Replace("sidewalk", "pavement")
    britishText = britishText.Replace("cookie", "biscuit")
    britishText = britishText.Replace("candy", "sweets")
    britishText = britishText.Replace("flashlight", "torch")
    britishText = britishText.Replace("gasoline", "petrol")
    britishText = britishText.Replace("hood", "bonnet")
    britishText = britishText.Replace("trunk", "boot")
    britishText = britishText.Replace("diaper", "nappy")
    britishText = britishText.Replace("soccer", "football")
    britishText = britishText.Replace("faucet", "tap")
    britishText = britishText.Replace("color", "colour")
    britishText = britishText.Replace("neighbor", "neighbour")
    britishText = britishText.Replace("center", "centre")
    britishText = britishText.Replace("theater", "theatre")
    britishText = britishText.Replace("license plate", "number plate")
    britishText = britishText.Replace("ocean", "pond")

    Return britishText
End Sub
?
 
Upvote 0

BertI

Member
Licensed User
Longtime User
Thanks guys. That is really weird or I'm being blinded by something... When I go to this page https://alphacephei.com/vosk/models I can't see this file under any of the categories in the table that comes up. Plenty of others in en-us or en-in variants but nothing of en-gb. Yet the full link link you provided did download the en-gb file. For my sanity, do you see this under some category heading in the table and if so which?
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
a couple false starts on google, then bing.com. came up pretty quick.
 
Upvote 0

BertI

Member
Licensed User
Longtime User
Ok not sure what you meant by that. Do you mean doing a search using the Bing search engine on the term 'vosk-model-small-en-gb-0.15' ? I still get pointed to this page: https://alphacephei.com/vosk/models which is the one which has, under headings for the English models,: English (various en-us types), English Other (various other en-us types), Indian English (couple of en-in types). I can't see any other headings or indeed file names under other headings which list an en-gb type?

Anyhow, also not listed but found reference somewhere to another en-gb model (vosk-model-en-gb-0.1) which I managed to download using the same method, i.e by using: https://alphacephei.com/vosk/models/vosk-model-en-gb-0.1.zip

This one appears to be a big model (~280Mb) and from its Readme doesn't sound like it is very good (old, not accurate)

Anyhow tried the small one so far. Not yet decided whether much better then the en-us one on my er, 'academic' accent. One thing to remind others is to ensure that you adjust the model folder names in the application which, after much stupidity on my part, I realised simply to change the definitions under Main Globals in the example (also in the AudioToText) so for example:

B4X:
    Public model_folder_name As String = "vosk-model-small-en-gb-0.15"
    Private model_zip_name As String = "vosk-model-small-en-gb-0.15.zip"
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…