Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

region support is not complete #9

Open
boltomli opened this issue Apr 21, 2020 · 5 comments
Open

region support is not complete #9

boltomli opened this issue Apr 21, 2020 · 5 comments

Comments

@boltomli
Copy link
Contributor

boltomli commented Apr 21, 2020

Voice availability on Azure is region specific. I updated ms_list_voices in #8, but unfortunately it turns out other functions may not support region well, such as get key, get token etc.

Major problems when using this feature:

  • If key is not westus, auth will fail (401)
  • Voice that are not available on westus (the embedded voice list) cannot be used, though can be queried from voice list API (by providing a different set of region and key).
@muschellij2
Copy link
Collaborator

What are you saying here? Revert the PR? What is the "feature". What action item do you want?

@boltomli
Copy link
Contributor Author

Sorry, got a slow network connection at the moment. Will update the issue later with more details.

@boltomli
Copy link
Contributor Author

boltomli commented Apr 22, 2020

I identified the error stack now. Repro steps:

  1. Get voices from a region that has more voices than "westus" (81 voices), such as "southeastasia".
> more_voices <- mscstts::ms_list_voices(api_key = "XXXX", region = "southeastasia")
> length(more_voices$Name)
[1] 106
  1. Try any neural voice in the list, but that is not found in ms_locale_df()
> res <- mscstts::ms_synthesize("valid voice in the region", voice = "en-IN-NeerjaNeural", api_key = "XXXX", region = "southeastasia")
Error in ms_voice_info(voice) : 
  Voice given is not a recognized voice! See ms_locale_df()

The error happens in ms_voice_info(). Currently this function validates voice against embedded ms_locale_df(), which is not an exhaustive list of available voices. It's simply because voice availability is not the same across different Azure regions.

To solve this problem:

Solution Pros Cons
Update ms_locale_df() to add more voices. Easy to modify. Keep runtime fast and stable. Have to update voice list from time to time to follow upstream. Not aware of different regions (a voice in this list may not be available in specific regions).
Refactor ms_locale_df() to add more voices per region. Keep runtime fast and stable. Aware of region differences. Have to update voice list from time to time to follow upstream. Lots of code changes.
Validate voice against dynamic list of voices. Accurate enough (when all is well.) Slower runtime. More requests bring more chance of failure.
Disable voice validation or use a warning instead of error. User friendly and flexible. Moderate code changes. A little too loose?

muschellij2 added a commit that referenced this issue Apr 22, 2020
@muschellij2
Copy link
Collaborator

I'd defer to the warning, but I added some lines in there - Can you see if the commit works now? See 5e7106b#diff-39708ad91ad640178ec80e250dc1ec5bR80

@boltomli
Copy link
Contributor Author

Thanks! Yes, with this commit the short name works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants