vue實作百度語音播報API呼叫
//百度語音播報
Vue.prototype.$speckText = function(str) {
var url = "http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&spd=6&text=" + encodeURI(str);
new Audio(url).play();
},
組件中使用
this.$speckText("hello world!")
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/292276.html
標籤:其他
上一篇:OpenCV4函式合集
