Converting Apple voices from a list of altNames to a localized string
#38
Closed
HadrienGardeur
started this conversation in
Ideas
Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
|
I'm closing that discussion since this is now a work in progress: #40 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As documented in #23, Apple has an inconsistent approach for voice names, where different string patterns are used, based on:
As I continue to add more and more languages to this project, it keeps on taking longer and longer to go back to every single language that I've already documented and add localized voices in
altNames.I'm tempted to move away from this approach and document locales instead. For example the English locale for Apple could look something like that:
{ "quality": { "medium": "Enhanced", "high": "Premium" }, "languages": { "en": "English" "fr": "French" }, "regions": { "fr": "France", "ch": "Switzerland", "be": "Belgium", "ca": "Canada" } }For each Apple voice, I would document a new
qualityproperty along with a newlocalizedVoiceproperty. Here's an example:{ "label": "Audrey (France)", "name": "Audrey", "note": "Audrey can be installed on all Apple devices and offers three variants. Like all voices that can be installed on Apple devices, it suffers from inconsistent naming due to localization.", "altNames": [ "Audrey (de qualité)", "Audrey (premium)", "Audrey (français (France))" ], "language": "fr-FR", "quality": [ "low", "medium", "high" ], "localizedVoice": "apple", "gender": "female", "rate": 1, "pitch": 1, "os": [ "macOS", "iOS", "iPadOS" ] }In contrast, here's the current approach where everything is listed in
altNames:web-speech-recommended-voices/json/fr.json
Lines 183 to 226 in cecfa69
Overall:
altNameswould continue to provide all possible variants for that voice's language, which would be a decent fallback for those who don't want to use code to generate the full list of voice namesaltNameslocalizedVoice,language,qualityandnavigator.languageI could easily generate additional voice namesen-usfornavigator.language, it would generate the following voice names using the localization file: "Audrey (Enhanced)", "Audrey (Premium)" and "Audrey (French (France))"The main downsides to this approach that I can currently identify:
The second one is fairly easy to work around (we could generate voice names for every single language supported), but less optimal than simply generating voice names for the user's locale.
Beta Was this translation helpful? Give feedback.
All reactions