onStart函数没任何反应(连调取录音都没有)
前天还可以使用。
var plugin = requirePlugin("myPlugin");
if (!wx.cloud) {
console.error('请升级微信,才能使用')
} else {
wx.cloud.init({
traceUser: true,
})
}
let manager = plugin.getSoeRecorderManager({
getAuthorization: function (callback) {
wx.cloud.callFunction({
name: 'getAuthorization',
data: {},
success: data => {
callback({
timestamp: data.result.timestamp,
authorization: data.result.authorization
})
}
})
}
});
console.log('2')
manager.onSuccess((res) => {
//打印识别结果
console.log(res)
});
console.log('3')
manager.onStart((res) => {
console.log("成功开始录音识别", res)
});
console.log('4')
manager.onStop((res) => {
console.log("录音已停止", res)
});
console.log('5')
manager.onError((res) => {
//打印错误
console.log(res)
})
console.log('6')
//开始评测
manager.start({
content: 'about'
})
console.log('7')
//停止评测
manager.stop()
}