How to enumerate voices in Azure Text to Speech in Javascript?

mkb13 11 Reputation points
2021-12-14T21:00:11.313+00:00

How do I enumerate the list of voices in Azure Cognitive Services Text to Speech in JavaScript? I can see how to do it in C# but not JavaScript. All I find is a web page with a hardcoded list (https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/language-support). (I cannot use C# because I'm using Blazor WebAssembly and the C# version of the speech library is not available -- reported a year ago: https://github.com/Azure-Samples/cognitive-services-speech-sdk/issues/930.)

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
2,061 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
3,602 questions
{count} vote

2 answers

Sort by: Most helpful
  1. Mohamed Bourarach 6 Reputation points
    2021-12-16T00:11:59.333+00:00

    Actually it's pretty easy to do. I'm working in a library that does the exact thing you are asking for. But to be sure. You are asking about getting in a select all the language options that Azure have in your region? Also you are using Vanilla js or Node.js

    1 person found this answer helpful.

  2. Ramr-msft 17,826 Reputation points
    2021-12-16T04:29:07.307+00:00

    Thanks, There is a REST API that will return the supported language list.

    Here is the link to the document.

    cognitiveservices/voices/list" via REST API is the recommended option as shown in this sample code.
    https://github.com/Azure-Samples/cognitive-services-speech-sdk/blob/master/samples/js/browser/public/synthesis.html#L306

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.