Cognitive-Speech-TTS
Cognitive-Speech-TTS copied to clipboard
How to make it read accented characters in Spanish?
It doesn't seem to be able to read words with accented characters when I send the request using the API endpoint.
However, it works when I use the sdk which uses wss but I don't plan to switch to that at the moment as it requires me to re-configure my server using docker.
I have checked the document on Azure website but there is no example for that.
This is what I used to send the TTS request.
test = "<speak version='1.0' xml:lang='en-us'><voice xml:lang='es-US' xml:gender='Male' name='es-US-AlonsoNeural'><prosody rate="0%">típico de los años</prosody></voice></speak>"
headers = {"Content-type" : "application/ssml+xml",
"X-Microsoft-OutputFormat" : "riff-24khz-16bit-mono-pcm",
"Authorization" : "Bearer " + auth_token,
"Content-length":str(len(text))
}
res = requests.post("https://westus2.tts.speech.microsoft.com/cognitiveservices/v1", data=text , headers=headers, timeout=29)
Thank you
is it encoding issue? https://stackoverflow.com/questions/708915/detecting-the-character-encoding-of-an-http-post-request
@szhaomsft I tried adding charset=UTF-8 but it still doesn't work. These are the headers that I used
headers = {"Content-type" : "application/ssml+xml; charset=UTF-8",
"X-Microsoft-OutputFormat" : "riff-24khz-16bit-mono-pcm",
"Authorization" : "Bearer " + auth_token,
"Content-length" : str(len(text))
}