Capacitor iOS - Error: There is no audio asset with key "xxxx" in the audio cache

So this is weird.

I’ve got my game working with Capacitor for iOS. But it will only work if I set:

audio: {
  noAudio: true
},

Or to disableWebAudio true to force HTML5 audio, but I don’t consider these solutions as one has no sound, and the other lags like crazy.

The game logs the following:
Error: There is no audio asset with key “xxxx” in the audio cache

Where xxxx is the name of my asset(s) (if I comment out one play call, the next one causes the same issue).

The sound works fine in the browser, but in a Capacitor app it doesn’t.

Any ideas?

For now I’m just using:

audio: {
  noAudio: (platform === 'ios')
},

To disable audio on iOS. But I would like to find a better solution than this.

That suggests something about the loading isn’t working. It’s odd. If there’s a problem creating the buffer source it seems there should be another error. Have you tried it directly in the browser?

Yeah in the browser it works fine.

I’ve worked around the issue for now by using howler. Not sure why it works but phaser doesn’t.