为什么ios无法播放音频文件,安卓可以。
const audio = wx.createInnerAudioContext() audio.autoplay = true; tid = that.data.inputValue[times]; audio.src = that.data.temp[tid]; audio.onPlay(() => { }) 写了个测试程序,大概就是调用 wx.getRecorderManager()录音,格式mp3,然后用 wx.saveFile保存文件,然后调用 wx.createInnerAudioContext() 播放。 安卓下没有任何问题。 在ios上,先用iphone 6s plus (ios12.1.4)测试,发现在savefile之前,使用临时文件名(tmp_开头)可以播放,save之后(文件名变为store_开头),就无法出声了,调试窗口也未提示出错。 我又换了个iphone X,发现save之前就是上面的问题了。 代码片断 https://developers.weixin.qq.com/s/nPUbMimJ7L7y