admin管理员组

文章数量:1609695

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

    • 代码参考

代码参考

/*
  * 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.

本文标签: 语音文字程序微信小