Reputation: 597
Doing some tests to synthesize parts of a book in portuguese (pt-BR) I noted that chapter names containing Roman numerals are not recognized as numbers if the numeral is above XXIX (39).
Like number L (50) or LX (60) will not be properly synthesized as a number and it will read as the letters. Using "say-as" SSMLS tag causes no change.
Is this expected ? Is there any possible workaround ?
Upvotes: 0
Views: 118
Reputation: 761
Another option you have is to customize your model, as described at https://console.bluemix.net/docs/services/text-to-speech/custom-intro.html#customIntro
Here goes a brief example
Use this command to create a custom model
curl -X POST -u ***:*** --header "Content-Type: application/json" --data "{\"name\":\"cURL Test\",\"language\":\"en-US\", \"description\":\"Customization test via cURL\"}" "https://stream.watsonplatform.net/text-to-speech/api/v1/customizations"
The command above will return the customization_id (in this case, e250e7ee-fbec-47e8-a1b8-59435c1b18e3)
then use this command to add a translation
curl -X PUT -u ***:*** --header "Content-Type: application/json" --data "{\"translation\":\"thirty\"}" "https://stream.watsonplatform.net/text-to-speech/api/v1/customizations/e250e7ee-fbec-47e8-a1b8-59435c1b18e3/words/XXX"
finally, try it
curl -X GET -u ***:*** --header "Accept: audio/wav" --output xxx.wav "https://stream.watsonplatform.net/text-to-speech/api/v1/synthesize?text=chapter%20XXX&customization_id=e250e7ee-fbec-47e8-a1b8-59435c1b18e3"
it will generate an audio file that says "chapter thirty"
ps. for PT-BR, see https://console.bluemix.net/docs/services/text-to-speech/custom-models.html#customModels so you can use the option "language" and translate XXX to "trinta"
Upvotes: 2
Reputation: 25220
Is this expected?
I would expect that, yes, developers are usually quite lazy to implement a generic solution.
Is there any possible workaround ?
Preprocess text yourself and convert numbers to words.
Upvotes: 2