How To Know If A Music Audio Source Resource Has Finished Loading?

Hi,

Trying to implement a “Loading Now” screen.
We load large music OGG files as Audio Sources at start of game.

How would we know when each music file has finished loading to update the “Loading Now” percentage?
Currently there is a 15 second delay where nothing happens while loading all the music.
Let us know, thanks!

Jesse

If you are loading the music bits yourself you can refactor to use Resources.LoadAsync()

If it is all part of a single scene, refactor to use the async scene load methods.

Both of the above let you hook progress of the async object if you want to put up a loading bar.

If neither of those is appealing (they can be fiddly), simply mark the the huge sounds as streaming (in the import window for the sound pieces) and then they will load almost instantaneously from a “ready to go” standpoint, but then when you play them Unity will stream them from disk for you as they play.

“simply mark the the huge sounds as streaming”

Tried the above and the load times are much improved.

Our target platforms are WebGL and Android.
Will streaming music work OK on above two platforms?
Thanks!

Jesse

You are more prepared to find this out than anyone else I know. :slight_smile:

I imagine it will but I haven’t studied it deeply. Perhaps googling or empirically testing will give you more info.