最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

text to speech - Which modern browsers support SSML? - Stack Overflow

programmeradmin3浏览0评论

Which browsers (if any) support SSML (Speech Synthesis Markup Language), specifically for speaking a single phoneme (such as the /h/ sound)?

The MDN suggests that it is supported but when I tried the demo it spoke the literal SSML I sent it (rather than speaking "tomato" )

What am I missing?

const synth = window.speechSynthesis;

const inputForm = document.querySelector("form");
const inputTxt = document.querySelector("input");
const voiceSelect = document.querySelector("select");

const voices = synth.getVoices();



const SSML = '<speak version="1.0" xmlns="" xml:lang="en-US">    <voice name="en-US-AvaNeural">        <phoneme alphabet="ipa" ph="tə.ˈmeɪ.toʊ"> tomato </phoneme>    </voice></speak>'


const utterThis = new SpeechSynthesisUtterance(SSML);

console.log(utterThis.text);
synth.speak(utterThis);
发布评论

评论列表(0)

  1. 暂无评论