0

我可以用纯文本很好地调用 Polly 服务。但是我现在想要做的是传递带有书签的文本(因为我想控制 Polly 放置时间信息的位置)但看不到如何将它传递给 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)
4

0 回答 0