将带有书签的文本传递到AWS Polly

时间:2018-02-08 14:59:54

标签: amazon-web-services amazon-polly

我可以使用纯文本调用Polly服务。然而,我现在要做的就是将带有书签的文本传递给它(因为我想控制Polly放置timimg离子信息的位置),但是看不到如何将它传递给Polly?

        SynthesizeSpeechRequest synthesizeSpeechRequest = new SynthesizeSpeechRequest()
            .withOutputFormat(OutputFormat.Json)
            .withSpeechMarkTypes(SpeechMarkType.Ssml)
            .withVoiceId(VoiceId.Joanna)
            .withText("<Mark> This is a sample <Mark> text to be synthesized");

        SynthesizeSpeechResult synthesizeSpeechResult = client.synthesizeSpeech(synthesizeSpeechRequest);

但我总是收到以下错误

 Exception caught: com.amazonaws.services.polly.model.SsmlMarksNotSupportedForTextTypeException: SSML Speech marks are not supported for this text type (Service: AmazonPolly; Status Code: 400; Error Code: SsmlMarksNotSupportedForTextTypeException; Request ID: 79daa5cc-0ce0-11e8-a64d-ef4f40dcae18)

0 个答案:

没有答案