this.audioCtx.play();

发布于 7 年前作者 yang548463 次浏览最后编辑 7 年前来自 ask

工具上可以播放 ios真机上不能播放  怎么回事

10 回复
gdai
gdai1 楼6 年前

解决了吗 我现在也是遇到IOS不能播放语音 安卓正常

rjin
rjin2 楼6 年前

你自己的可以在ios上播放出声音吗?

vtian
vtian3 楼6 年前

that.audioCtx = wx.createAudioContext(‘myAudio’);

xiexiulan
xiexiulan4 楼6 年前
wx.downloadFile({
      url: that.data.mysite + '/data/step_stand.mp3',
      success: function (res) {
        that.audioCtx.setSrc(res.tempFilePath);
        that.audioCtx.play();
        setTimeout(function () {
          wx.downloadFile({
            url: that.data.mysite + '/data/step_walk.mp3',
            success: function (res) {
              that.audioCtx.setSrc(res.tempFilePath);
              that.audioCtx.play();
              setTimeout(function(){
                that.startBtn();
                setTimeout(that.autofinish, 10000);
              },4000)
            }
          })
        }, 6000);
         
      }
    })
qianjing
qianjing5 楼6 年前

帮我看下,是有啥问题吗?

haofang
haofang6 楼6 年前
onLoad: function () {
    var that = this;
    that.audioCtx = wx.createAudioContext('myAudio');
    wx.downloadFile({
      url: that.data.mysite + '/data/step_stand.mp3',
      success: function (res) {
        that.audioCtx.setSrc(res.tempFilePath);
        that.audioCtx.play();
        setTimeout(function () {
          wx.downloadFile({
            url: that.data.mysite + '/data/step_walk.mp3',
            success: function (res) {
              that.audioCtx.setSrc(res.tempFilePath);
              that.audioCtx.play();
              setTimeout(function(){
                that.startBtn();
                setTimeout(that.autofinish, 10000);
              },4000)
            }
          })
        }, 6000);
         
      }
    })
    that.onTimeChange();
     
    
  },
guojing
guojing7 楼6 年前

你是咋写的,我看下,我这边没找出来是啥问题

aguo
aguo8 楼6 年前

可以  肯定是代码的原因  多测一测

shenjuan
shenjuan9 楼6 年前

这个我写了,代码里面我没有复制进去

yaoqiang
yaoqiang10 楼5 年前

我这边安卓播放有声音,但是ios上面就没有声音