Alex3m3ti8
Alex3m3ti8

Reputation: 1

Azure Cognitive Service TTS Custom Voice endpoint testing

I have a node.js TTS Azure Cognitive Service which works great. (https://github.com/jishi/node-sonos-http-api). I am able to use Neural voices in EASTUS and everything works great.

I have just gone through the process of creating a Custom Voice. The portal shows the Custom Voice Model and Endpoint both successfully deployed. I can use the Check endpoint Test and in the portal, it speaks like my custom voice should.

But when I modify the node.js code (with the new BASEURL and URI and Voice) I get 400 errors.

So back to basics. I was using PowerShell to simply try to see if the EndPoint is working.

When I do the following to test the regular voices...

$FetchTokenHeader = @{
  'Content-type'='application/x-www-form-urlencoded';
  'Content-Length'= '0';
  'Ocp-Apim-Subscription-Key' = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}

$OAuthToken = Invoke-RestMethod -Method POST -Uri https://eastus.api.cognitive.microsoft.com/sts/v1.0/issuetoken -Headers $FetchTokenHeader

# show the token received
$OAuthToken

    $headers = @{'Authorization'='Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}

Invoke-RestMethod -Method GET -Uri https://eastus.tts.speech.microsoft.com/cognitiveservices/voices/list -Headers $headers

Works great. I see all the list of available voices.

When I change to

Invoke-RestMethod -Method GET -Uri https://eastus.voice.speech.microsoft.com/cognitiveservices/v1?deploymentId=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -Headers $headers

To check if my voice is available (https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/rest-text-to-speech#custom-voices), I get The remote server returned an error: (404) Not Found. But in the Custom Voice Portal, under Deployment, the Endpoint is deployed. The Subscription Key is the same (all under the same subscription that is working for regular voices). The Datacenter EASTUS is the same.

Any suggestions on why the Custom Voice endpoint might not be working? Thanks!

Upvotes: 0

Views: 618

Answers (1)

Stanley Gong
Stanley Gong

Reputation: 12153

I think this endpoint :

https://eastus.voice.speech.microsoft.com/cognitiveservices/v1?deploymentId={deploymentId}

Is available as it works perfectly for me while I use POST method to get a audio file via this endpoint by the C# code provided here : enter image description here

Indeed , if you use GET method to call this endpoint , you will get 404 code.This means there is no resource for GET method , but you should use POST method to call it .

Upvotes: 0

Related Questions