- 字符串怎么转成byte[]?
var str = '{\"end\":true}' 怎么把这个字符串转成byte[]呀 录音结束发结束符给后台 后台要求把这个字符串转成byte[]
2019-11-27 - 录音实时流上传怎么实现?
//开始录音的时候 start: function () { this.setData({ sayimg: '',//图片样式 anmationShow: true, }) //开始录音 wx.showLoading({ title: '录音中', mask: true }) recorderManager.start(options); recorderManager.onStart(() => { console.log('recorder start') }); //错误回调 recorderManager.onError((res) => { console.log(res); }) recorderManager.onFrameRecorded((res) => { const { frameBuffer } = res console.log('frameBuffer', frameBuffer) sendSocketMessage(frameBuffer) }) let socketOpen = false const socketMsgQueue = [] wx.connectSocket({ url: 'wss://地址' }) wx.onSocketOpen(function (res) { socketOpen = true }) function sendSocketMessage(msg) { console.log(msg) if (socketOpen) { wx.sendSocketMessage({ data: msg }) } else { socketMsgQueue.push(msg) } console.log(msg) } wx.onSocketError(function(res){ console.log('WebSocket连接打开失败') }) wx.onSocketMessage(function (res) { console.log('收到服务器内容' + JSON.stringify(res)) }) }, //停止录音 stop: function () { wx.hideLoading(); this.setData({ sayimg: '', anmationShow: false, }) var that = this; recorderManager.stop(); recorderManager.onStop((res) => { that.tempFilePath = res.tempFilePath; console.log('recorder end') console.log('停止录音', res.tempFilePath) const { tempFilePath } = res; }) },
2019-11-25 - 录音时长设置10分钟(600000ms)但是录音有时候几分钟有时候十几秒就停止录音为什么呢
[图片] [图片]
2019-10-24 - 录音要求只能录4秒以内,然后怎么做到自动停止录音呢?
录音要求只能录4秒以内,然后怎么做到自动停止录音呢?
2019-08-23