I am calling the Voice.getName()
method like so:
Set<Voice> voices = tts.getVoices();
String name = voice.getName();
This returns code names rather than friendly display names. What I want is a display name, but there doesn't seem to be any way to get this.
Is it possible to translate the codes into something meaningful to create user friendly names? And to eliminate duplicates? A lot sound similar - but just a little bit different.
These are some codes returned for English UK:
en-GB-language
en-gb-x-rjs-local
en-gb-x-rjs-network
en-gb-x-fis-local
en-gb-x-fis-network
en-gb-x-fis#female_1-local
en-gb-x-rjs#female_1-local
en-gb-x-rjs#female_2-local
en-gb-x-fis#female_2-local
en-gb-x-rjs#male_1-local
My thoughts so far:
rjs
and fis
are repeated a lot, and apply to both male and female, but only for UK English. It appears that each language has one or two different sets of 3 letter initials - maybe it is a region code. en-gb-x-rjs#male_1-local
and en-gb-x-rjs-local
are identicalDoes anyone have a better understanding of these?
With text-to-speech, your device can convert text input and play audio aloud.
Select Google text-to-speech engine. Step 4: Now tap on the Settings icon to check for voice data. Step 5: Under this section, tap on Install Voice Data. This shows you the available for download Google TTS voice data.
This may or may not be helpful, but for those of you not working directly with Android, and thus without access to an API that lists the voice codes, I've just found this URL on a forum thread which seems to list the URLs of the android TTS voices:
https://dl.google.com/dl/android/tts/v2/voices-list-r1.proto
Reading that as text (utf-8) gives some decoding errors, but it's enough to extract the codes:
en-GBGhttps://dl.google.com/dl/android/tts/v2/en-gb-x-fis-phone-hmm-r2.zvoice ����dBfemaleJen-gb-x-fis-phone-hmmP�X�`hen-GB #1x�$�
en-GBJhttps://dl.google.com/dl/android/tts/v2/en-gb-x-fis-diphone-usel-r2.zvoice ؾ0���dBfemaleJen-gb-x-fis-diphone-uselP�X�`hen-GB #1x��
en-GBGhttps://dl.google.com/dl/android/tts/v2/en-gb-x-rjs-phone-hmm-r2.zvoice �0���dBmaleJen-gb-x-rjs-phone-hmmP�X�`hen-GB #2x��
en-GBJhttps://dl.google.com/dl/android/tts/v2/en-gb-x-rjs-diphone-usel-r2.zvoice ��0���dBmaleJen-gb-x-rjs-diphone-uselP�X�`hen-GB #2x���
en-USGhttps://dl.google.com/dl/android/tts/v2/en-us-x-sfg-phone-hmm-r2.zvoice �*0���dBfemaleJen-us-x-sfg-phone-hmmP�X�`hren-USx�6�
en-USJhttps://dl.google.com/dl/android/tts/v2/en-us-x-sfg-diphone-usel-r4.zvoice ��
0���dBfemaleJen-us-x-sfg-diphone-uselP�X�`hren-USx���
de-DEGhttps://dl.google.com/dl/android/tts/v2/de-de-x-nfh-phone-hmm-r2.zvoice �"0���dBfemaleJde-de-x-nfh-phone-hmmP�X�`hrde-DEx�+�
pt-BRGhttps://dl.google.com/dl/android/tts/v2/pt-br-x-afs-phone-hmm-r2.zvoice ����dBfemaleJpt-br-x-afs-phone-hmmP�X�`hrpt-BRx�#�
es-ESGhttps://dl.google.com/dl/android/tts/v2/es-es-x-ana-phone-hmm-r2.zvoice �#0���dBfemaleJes-es-x-ana-phone-hmmP�X�`hres-ESx�.�
es-USGhttps://dl.google.com/dl/android/tts/v2/es-us-x-sfb-phone-hmm-r2.zvoice �*0���dBfemaleJes-us-x-sfb-phone-hmmP�X�`hres-USx�6�
fr-FRGhttps://dl.google.com/dl/android/tts/v2/fr-fr-x-vlf-phone-hmm-r2.zvoice �.0���dBfemaleJfr-fr-x-vlf-phone-hmmP�X�`hrfr-FRx�>�
it-ITGhttps://dl.google.com/dl/android/tts/v2/it-it-x-kda-phone-hmm-r2.zvoice �,0���dBfemaleJit-it-x-kda-phone-hmmP�X�`hrit-ITx�>�
ko-KRGhttps://dl.google.com/dl/android/tts/v2/ko-kr-x-ism-phone-hmm-r2.zvoice �00���dBfemaleJko-kr-x-ism-phone-hmmP�X�`hrko-KRx�:
I still don't know what the codes mean, but at least this gives me the mapping between the language codes and the fis
, rjs
, etc codes, so it's a start.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With