AWS Polly Pinyin doesn't say certain things. Is there a document with valid Pinyin?

0

Take for example 貪小便宜. If I put this text into the console, it correctly speaks it. tan xiao bian yi. However if I input SSML as follows: <speak><prosody rate='slow'><phoneme alphabet="x-amazon-pinyin" ph="tan1 xiao3 pian2 yi2">貪小便宜</phoneme></prosody></speak>, the voice only says tan pian yi, it skips the xiao. I know certain Pinyin can be romanized in different ways, but xiao seems to be pretty standard from what i've seen. I've also tried xiao1-4 none of which worked.

Is there a way to get a list of the valid pinyin for Polly so I can normalize my pinyin to use what is accepted by Polly? I know the voice can say what I'm looking for, as it works when I put the chinese characters in, however for my usecase they won't always be as readily available as the Pinyin, but the Pinyin seems to be less consistent.

pejrich
asked a month ago46 views
1 Answer
0
Accepted Answer

Nevermind. As is always the case, I spent a long time looking for answers before posting, and minutes after posting I find a solution.

The phoneme tag needs to be split up. So it needs to be sent to Polly as:

<speak>
<prosody rate='slow'>
<phoneme alphabet="x-amazon-pinyin" ph="tan1"></phoneme>
<phoneme alphabet="x-amazon-pinyin" ph="xiao3"></phoneme>
<phoneme alphabet="x-amazon-pinyin" ph="pian2"></phoneme>
<phoneme alphabet="x-amazon-pinyin" ph="yi2"></phoneme>
</prosody>
</speak>

This behavior is different from the standard IPA which does seem to accept arbitrary lengths of IPA under a single phoneme tag.

pejrich
answered a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions