class WxSoundManager { private static _instance: WxSoundManager = new WxSoundManager; public static getIns(): WxSoundManager { return this ._instance; } private audio: InnerAudioContext = null ; private constructor() { } public bgMPlay() { if (! this .audio) { this .audio = wx.createInnerAudioContext(); this .audio.src = GameConst.soundRes.bgm; this .audio.loop = true ; this .audio.volume = GameDataManager.ins.bgmVolume; this .audio.stop(); this .audio.play(); return ; } else { if ( this .audio.paused) { this .audio.play(); this .audio.volume = GameDataManager.ins.bgmVolume; } } } public bgMStop() { if ( this .audio) { this .audio.stop(); this .audio.destroy(); this .audio = null ; } } public bgMPause() { if ( this .audio) { this .audio.pause(); } } public setBgmVolume(volume: number) { if ( this .audio) { this .audio.volume = volume; } } public soundEffectPlay(_url: string) { let effect: InnerAudioContext = wx.createInnerAudioContext(); effect.src = _url; effect.volume = GameDataManager.ins.soundEffVolume; effect.stop(); effect.play(); effect.onEnded(() => { effect.destroy(); }); } } |
audio的volume属性在微信开发者工具上没有问题,在真机上完全没有起到任何作用,背景音乐、背景音效播放的都是音频原始音量。请问有人遇到相同的问题吗,该怎么解决?我用的是Egret5.2.29,开发者工具是最新版本,手机是红米K20,Android9。
音频是混音还没支持的哈
这个问题有恢复吗? 还是解决不了了吖? 2023年了依然有这个问题
非常抱歉,我们将会在最近的版本修复该问题