No sound from assetbundle on iOS

I have an asset bundle which contains a prefab using various 3d assets, and audio file which is assigned to a Timeline which plays when the prefab is loaded. This works fine on Android, but I get no sound on iOS.
I’ve loaded the iOS asset bundle on windows and mac, and while the shaders are of course messed up, the audio plays just fine.

Here’s what I’ve tried so far:

  • Creating the asset bundle from a mac instead of Windows
  • Adding the audio file to a unity build and playing it, to ensure that it will in fact play in a build. It does.
  • Checking for a mute button on my device (it’s an ipad, so doesn’t have one, but also check previous point… audio plays, it’s just the audio from the assetbundle that doesn’t)
  • Changing the compression in the audio import settings from the default Vorbis to PCM.
  • Updating Unity to the latest 2022.3 LTS

I don’t see any errors in the logs when running from xcode.

Hoping someone has ideas for what may be wrong, or how I could debug this further. Thanks!

Let me congratulate you on a VERY thorough matrix of cross-testing / cross-checking. Very refreshing to see here!

The only additional thing I can think of is to replace that sound with another… does that work?

One other thing: doublecheck that none of your code might be order-of-execution dependent, like if you stop the sound at start always using some common “load stuff” script, then run the timeline, and somehow that gets out of order only on iOS.

And what about just plopping the audio file into an autoplay GameObject somewhere in that asset bundle??

Thank you :sunglasses:.

There’s actually no code, just a Timeline. And along that line of thinking, and with your last suggestion, YES, it does play the sound if I just put it on a game object with autoplay turned on.

So it seems the issue is actually with the timeline :thinking:. I’ll need to do some more debugging to see if it’s just the audio on the timeline that’s not working, or if none of the timeline is working.

1 Like