为什么ios无法播放音频文件,安卓可以。
发布于 4 年前 作者 xiulan89 15396 次浏览 来自 问答

          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

1 回复

麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

回到顶部