微信小程序实现文字转语音

微信小程序实现文字转语音——插件:微信同声传译

代码参考

/*
  * A JavaScript For AudioContext And WechatSI , voice play
  * 注意事项:该函数需要小程序:”微信同声传译“ 插件支持,在微信公众平台-设置-第三方服务中添加此插件 
    (Note: this function requires small program: "WeChat simultaneous interpretation" plug-in support, add this plug-in in WeChat public platform-setting-third party service)

  * 使用注意事项: 在小程序app.json 中添加插件,在需要的页面引入js
  (Notes for use: add a plug-in in the small program app.json, and introduce js into the required page )

  * "plugins": {
      "WechatSI": {                       // 插件名称
        "version": "0.3.3",               // 插件版本
        "provider": "wx069ba97219f66d99"  // 插件appid
      }
    }

  * 需要转换为语音的文字作为必要参数传入: AudioContext.AudioContext(参数);
  (Text that needs to be converted to speech is passed in as a necessary parameter: AudioContext.AudioContext(params))
*/

const plugin = requirePlugin('WechatSI');

function AudioContext(content) {
   
  const innerAudioContext = wx.
  • 2
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值