You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of our work on voice selection, one of the very first things that we need to do is to filter out very low quality and novelty voices.
Very low quality voices are broken down into two groups:
Eloquence voices on Apple devices
and eSpeak voices on Chrome OS
Eloquence voice suffer from the usual Apple approach which means that they can show up with two different name/voiceURI when calling getVoices():
"Name"
or "Name (Language (Country))" where language and country are localized based on country settings
It's also worth pointing out that for each of these Apple voice, we'll usually find 14 different match across as many different languages. These languages are all identified using language and otherLanguages in the JSON file documenting these voices.
eSpeak voices are much more straightforward and matching them based on their name is enough.
For novelty voices, the situation is a little different. They're also localized by Apple, but not in a way that can be easily predicted. For example "Bad News" gets translated into "Mauvaises nouvelles" in French and "Malas noticias" in Spanish.
In the JSON, these translations are listed under altNames while the English names are in name.
In order to filter out these very low quality voices and novelty voices, we can follow these steps:
obtain all voices from the Web Speech API using getVoices()
iterate through voices from these two lists
try to find one or more match for each voice based on name using a regular expression that accepts any character after the string extracted from name, if any results are found, remove them from the list of voices and skip to the next voice in the list
try to find an exact match for each voice based on values in altNames, if any result is found, remove it from the list of voices and skip to the next voice in the list
The text was updated successfully, but these errors were encountered:
As part of our work on voice selection, one of the very first things that we need to do is to filter out very low quality and novelty voices.
Very low quality voices are broken down into two groups:
Eloquence voice suffer from the usual Apple approach which means that they can show up with two different
name
/voiceURI
when callinggetVoices()
:It's also worth pointing out that for each of these Apple voice, we'll usually find 14 different match across as many different languages. These languages are all identified using
language
andotherLanguages
in the JSON file documenting these voices.eSpeak voices are much more straightforward and matching them based on their
name
is enough.For novelty voices, the situation is a little different. They're also localized by Apple, but not in a way that can be easily predicted. For example "Bad News" gets translated into "Mauvaises nouvelles" in French and "Malas noticias" in Spanish.
In the JSON, these translations are listed under
altNames
while the English names are inname
.In order to filter out these very low quality voices and novelty voices, we can follow these steps:
getVoices()
name
using a regular expression that accepts any character after the string extracted fromname
, if any results are found, remove them from the list of voices and skip to the next voice in the listaltNames
, if any result is found, remove it from the list of voices and skip to the next voice in the listThe text was updated successfully, but these errors were encountered: