Search code examples
azuretext-to-speechazure-gov

Azure Text to Speech service not responding


I've implemented and am testing the Azure text to speech with the official github examples using both the Microsoft.CognitiveServices.Speech api and a traditional REST implementation using HttpRequests, but no matter what method i try i get 401/400 errors when submitting the text to the service.

My test application authenticates correctly and is issued a valid token from the Auth Token Service, using a valid gov cloud account but the calls to the speech services endpoint themselves fail or are dumped.

I'm using the endpoint information documented at https://learn.microsoft.com/en-us/azure/azure-government/documentation-government-services-aiandcognitiveservices as this is for a configured GovCloud and not the public cloud.

Update: After manually recreating the REST calls and using online REST testing tools, and then getting on the phone with the Azure cognitive services team, it turns out the issue is with Azure's endpoints for gov cloud speech services and their documentation. (They're not sure what exactly, but will look into it...)


Solution

  • It turns out the official documentation is inaccurate, the docs list "https://virginia.tts.speech.azure.us" as the service endpoint when it is in actual "https://virginia.tts.speech.azure.us/cognitiveservices/v1"

    Hopefully this saves whoever finds this the 16 hours it took to debug and resolve the issues.

    As a side note, the generated SSML in the REST example on the azure github is malformed, use the example structure from the documentation instead.