我试图做出阿拉伯语SpeechSynthesisUtterance
工作
它的工作罚款英语
$(document).ready(function() {
var u1 = new SpeechSynthesisUtterance('Hello world!');
u1.lang = 'en-US';
u1.pitch = 20;
u1.rate = 1;
u1.voiceURI = 'native';
u1.volume = 1000;
speechSynthesis.speak(u1);
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
但是,当阿拉伯语使用
$(document).ready(function() {
var u1 = new SpeechSynthesisUtterance('عربي');
u1.lang = 'ar-AE';
u1.pitch = 20;
u1.rate = 1;
u1.voiceURI = 'native';
u1.volume = 1000;
speechSynthesis.speak(u1);
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
任何想法,我做错了什么?
该SpeechSynthesisUtterance
功能不支持阿拉伯语,并用各自的声音only supports the following languages:
speechSynthesis.onvoiceschanged = function() {
var voices = this.getVoices();
console.log(voices);
};