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

Azure神经TTS自定义词典未生效问题求助

Azure神经语音TTS自定义词典不生效问题

使用Python Speech Services模块调用Azure神经语音TTS时,配置自定义词典后未达到预期效果:

  • 词典文件已存储在匿名可读的Azure Blob Storage中
  • 已通过递增文件名后缀(如lexicon3.xml)规避Azure的15分钟缓存规则
  • 但SSML中的“BTW”仍按默认的“By the way”发音,而非词典定义的“By the flippin' way”

自定义词典文件内容

<?xml version="1.0" encoding="utf-8"?>
<lexicon xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:schemaLocation="http://www.w3.org/2005/01/pronunciation-lexicon http://www.w3.org/TR/2007/CR-pronunciation-lexicon-20071212/pls.xsd" 
         version="1.0" 
         alphabet="ipa" 
         xml:lang="en-US" 
         xmlns="http://www.w3.org/2005/01/pronunciation-lexicon">
  <lexeme>
    <grapheme>BTW</grapheme>
    <alias>By the flippin' way</alias>
  </lexeme>
</lexicon>

调用使用的SSML内容

<speak xmlns="http://www.w3.org/2001/10/synthesis" 
       xmlns:mstts="http://www.w3.org/2001/mstts" 
       xmlns:emo="http://www.w3.org/2009/10/emotionml" 
       version="1.0" 
       xml:lang="en-US">
  <voice name="en-US-EmmaNeural">
    <lexicon uri="https://<mynamespace>.blob.core.windows.net/ttsfiles/lexicon3.xml"/>
    The phrase is: BTW
  </voice>
</speak>

注:SSML中的<mynamespace>为隐去的存储账户命名空间


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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.17 19:07:18