微信小游戏wx.createInnerAudioContext()快速连续点击播放音效延迟?

小游戏 企业微信 微信支付 小程序 文章 2020-07-30 17:30 1343 0 全屏看文

AI助手支持GPT4.0

微信小游戏wx.createInnerAudioContext()快速连续点击播放音效延迟?

wx.createInnerAudioContext()

同样的API,在微信开发者工具、微信小程序(安卓机、苹果机)、微信小游戏(苹果机)连续点击调用该api播放音效不会有太大的延迟,但在微信小游戏(安卓机)有明显延迟,不知道怎么破。

我现在的写法是先用wx.downloadFile()把线上音频文件下载到本地,得到tempFilePath本地音频地址,然后在连续点击事件调用wx.createInnerAudioContext()创建不同的audio 上下文去播放音频。

不知道哪里出了问题,在线急求解~~

wx.createInnerAudioContext () for the same API, there will be no great delay in calling the API continuously in wechat developer tools, wechat applets (Android, Macintosh), and wechat games (Macintosh), but there is obvious delay in wechat games (Android), so I don't know how to break it. The way I write it now is to use it first wx.downloadFile () download the online audio file to the local, get the local audio address of tempfilepath, and then call it by clicking the event continuously wx.createInnerAudioContext () create different audio contexts to play audio. Do not know where the problem, online urgent solution~~

回答:

Forever:

升级安卓版的微信版本到7.0.17,再看一下还没有这个问题?,因为这个问题是已知BUG

风领-曾彬思:频繁播放同一个音频文件,也会出现没有声音的情况。游戏内做多米诺倒地的效果,播放间隔是0.2s。安卓必现
Forever:不是说了吗?是已知bug,一个月前我们这边就发现了
风领-曾彬思:7.0.17依然存在啊
Forever:等待基础库2.12.1的发布

-EOF-

AI助手支持GPT4.0