Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Well, the "testing" part of things always produces more work.

I have a bunch of audio clips, about 15 of them, which are all about 30 seconds long. I've been using LibGDX's Music class for them: I pre-loaded them in the AssetManager, then retrieved and played them when needed. It worked great on desktop. It worked great on small tests on my phone.

But on a full playthrough on my phone, the later musics just wouldn't play. At all. Silence. Even worse, LibGDX seemed to think they were playing, so I couldn't detect that they had failed to play.

I was about to beat my head into the wall, when I noticed this line from the documentation about Music:

Music instances are heavy, you should usually not have more than one or two at most loaded.

Oops. I switched things around to only load the Music as soon as it was needed, and to dispose the old Music as soon as it stopped. That did the trick, and now all the sounds play correctly. I guess it pays to read the documentation!