- audioContext和innerAudioContext无法播放本地音频
把recorderManger录制后生成的res.tempFilePath赋值给src 不报错也不播放 在audio文件夹中可以找到录制的音频,表明录制成功,tempFIlePath有值 为wxFile://tmp_*.m4a 但就是不播放 应该是audioContext和innerAudioContext的BUG吧ヾ(。 ̄□ ̄)ツ゜゜゜求解答
2017-10-19 - 用innerAudioContext 播放录制的音频真机报错
android无任何反映 不报错 不播放 ios :报错 operateAudio:fail audioinstance is palying or waiting 代码 var tempFilePath; const innerAudioContext = wx.createInnerAudioContext(); innerAudioContext.onPlay(() => { console.log('开始播放') }); innerAudioContext.onError((res) => { console.log(res.errMsg) console.log(res.errCode) }); const recorderManager = wx.getRecorderManager(); const option = { duration: 100000, sampleRate: 44100, numberOfChannels: 1, encodeBitRate: 192000, format: 'aac' //frameSize: 50 } recorderManager.onStart(() => { console.info('recorder start') }) recorderManager.onResume(() => { console.info('recorder resume') }) recorderManager.onPause(() => { console.log('recorder pause') }) recorderManager.onStop((res) => { console.info('recorder stop'); tempFilePath = res.tempFilePath; console.info(tempFilePath,res); }) Page({ ... startRecord:function(e){ recorderManager.start(option); } , stopRecord: function (e) { recorderManager.stop(); }, playVoice: function (e) { console.info(tempFilePath); innerAudioContext.src=tempFilePath; console.info("start play") innerAudioContext.play(); console.info("end") } .... })
2017-10-19 - 新出的recorderManger录制的音频怎么播放
在API中找不到相关说明ヾ(。 ̄□ ̄)ツ゜゜゜
2017-10-18 - 小程序wx.getRecorderManager()录制的音频怎么播放
萌新第一次做小程序,求各位大神解答下ლ(╹◡╹ლ)ლ(╹◡╹ლ) 用wx.getRecorderManager()获取到tempFilePath之后 怎么播放呀 用wx.playVoice无效 用wx.createInnerAudioContext()话 怎么使用tempFilePath呢?src直接填写tempFilePath话无效
2017-10-17