🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
语音合成使用的是腾讯AI开放平台的sdk,申请请看第三方平台申请—>腾讯语音合成 ### **BSL.SpeechSynthesis(voicer,'text','callbackMethod')** | 参数 | 必填 | 说明 | | --- | --- | --- | | voicer| 是 | 发音人,传入int型 | | text| 是 | 合成语音的文字 | | callbackMethod | 是 | 回调的JS函数,将合成的结果返回。success为成功,其他为失败。 | 发音人参数 ![](http://h-img.bslyun.com/f01488f4e0b51c9b9185855d5486cc0d) 错误码 ![](http://h-img.bslyun.com/44cf865275b299aac4975ad0c1c8c3a4) 上面截图来自腾讯平台:[https://cloud.tencent.com/document/product/1073/37995](https://cloud.tencent.com/document/product/1073/37995) **调用示例** ``` <script type="text/javascript"> function result(r){ alert(r); } </script> <a href="#" onclick="BSL.SpeechSynthesis(0,'欢迎使用变色龙平台','result')">语音合成</a> ```