REST URL for TTS

Daniel Nalesnik 1 Reputation point
2021-07-22T12:39:56.503+00:00

I'm trying to use Microsoft Azure's Cognitive Services TTS to convert written Chinese into spoken audio. I have a Chinese-language learning app that includes a dictionary of 120,000+ Chinese words.

I was previously using TTS from Baidu, which let me dynamically reference audio with a URL that looked something like this:

https://tsn.baidu.com/text2audio?tex=战(zhan4)线(xian4)&lan=zh&spd=4&tok={my token that was re-generated every month}

This was useful for three reasons:

  1. I could embed this into an HTML audio tag and play it with JavaScript only when (or if!) I ever needed it.
  2. I did not need to store the audio anywhere -- it was always available through the URL.
  3. As the speech engine improved over the years, the quality of my app's audio improved.

With Microsoft Azure, I've figured out how to create TTS audio, but it seems as if the result must always be downloaded and saved in order for me to do anything with it.

Thus:

  1. I have to create millions of audio files and then save them (Amazon S3) ahead of time, even if I may never need them.
  2. I will never get updates to the voice quality unless I re-run a batch process to re-create all the audio again.

Am I missing something? Is it true that I can't create URLs for audio I want converted on the fly by Azure TTS?

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,834 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. GiftA-MSFT 11,166 Reputation points
    2021-07-24T00:26:51.553+00:00

    Hi, thanks for reaching out. Is this what you're looking for Text-to-speech REST API? Let us know if this helps your scenario. Thanks.


  2. GiftA-MSFT 11,166 Reputation points
    2021-07-28T22:00:42.393+00:00

    Hi, quick follow-up. I confirmed with the product group. We don't currently support this scenario. Our recommendation is to output the audio to blob storage (to generate SAS url). For more information, review Azure Blob Storage. Hope this helps.

    0 comments No comments

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.