Phaser 3 + Web Audio Help

Hi

Everything, all sound works fine on Android and on Google Chrome on Windows.

However, when trying to put my Phaser 3 game on iOS, it only works when i use html5Audio:

  audio: {
    disableWebAudio: true,
  },

However, the moment I remove disableWebAudio: true, I get the following error:

[log] - %c %c %c %c %c Phaser v3.22.0 (WebGL | Web Audio) %c https://phaser.io background: #ff0000 background: #ffff00 background: #00ff00 background: #00ffff color: #ffffff; background: #000000 background: #fff
⚡️  [error] - ERROR {"line":83764,"column":28,"sourceURL":"capacitor://localhost/scripts.js"}
⚡️  [error] - ERROR Error: There is no audio asset with key "hit" in the audio cache

All audio is mp3, and ogg, and 44.1k

this.load.audio(ASSET_KEYS.WING_SOUND, ['assets/sounds/sfx_wing.ogg', 'assets/sounds/sfx_wing.mp3']);
this.load.audio(ASSET_KEYS.HIT_SOUND, ['assets/sounds/sfx_hit.ogg', 'assets/sounds/sfx_hit.mp3']);
this.load.audio(ASSET_KEYS.DIE_SOUND, ['assets/sounds/sfx_die.ogg', 'assets/sounds/sfx_die.mp3']);
this.load.audio(ASSET_KEYS.WOOSH_SOUND, ['assets/sounds/sfx_swooshing.ogg', 'assets/sounds/sfx_swooshing.mp3']);
this.load.audio(ASSET_KEYS.POINT_SOUND, ['assets/sounds/sfx_point.ogg', 'assets/sounds/sfx_point.mp3']);

Can someone help

P.S.

The same also works when I do noAudio: true:

audio: {
    noAudio: true,
},

This is strange.

Yes it is

Do you have any clue why?

Only HTML5 Audio works, but its very slow, and iOS only allows one “hit” sound to be played simultaneously, so you cant hit people multiple times…

You need to ask for multiple copies when loading. There is a thread here somewhere.

For the Web Audio problem, that sounds like the audio files aren’t getting loaded or aren’t getting processed after loading. Some logging may help.

I believe this thread is related

But there is no solution once again:

I can’t seem to get a stack trace up on XCode but I have found that this area of the code fails

image

this.sounds.push(sound); never gets hit