You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

ari包配合Amazon Polly使用时SSML功能的使用方法咨询

你遇到的SSML不生效问题是因为ari包默认关闭了SSML解析开关,需要手动在ari_spin函数中添加ssml = TRUE参数开启解析,同时需要调整输入的文本格式符合SSML要求。

修正后的可运行代码

slides <- system.file("test", c("mab2.png", "mab1.png"),
                      package = "ari")
# 所有句子都必须完整包裹在<speak>根标签内
sentences <- c("<speak>Welcome to my very <s> interesting lecture.</speak>",
               "<speak>Here are some fantastic <s> equations I came up with.</speak>")
# 新增ssml = TRUE参数开启SSML解析
ari_spin(slides, sentences, voice = "Brian", output = "Videos/slides_test_test.mp4", ssml = TRUE)

注意事项

  • 开启ssml = TRUE后,所有传入sentences的文本都必须符合Amazon Polly的SSML语法规范,必须以<speak>作为根节点包裹全部内容,否则会触发Polly的解析报错
  • 如果文本内容中包含&、<、>等特殊字符,需要转义为&amp;、&lt;、&gt;实体符号,避免被识别为标签
  • 你使用的<s>标签为句子分隔标签,会在标签前后自动增加适合句子停顿的时长,如果需要实现单词重音、语速调整等效果,可以使用<emphasis>、<prosody>等其他标准SSML标签

内容的提问来源于stack exchange,提问作者Bernd

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.05 06:18:03