Search code examples
javaandroidandroid-studiolibgdx

LibGDX AssetManager loads .wav file on emulator, but not on mobile device


I don't think I have ever been more confused in my life. I have a little jingle in my LibGDX game that is played when the player dies. It works just fine in AndroidStudio's emulators, but when I connect my phone and try to run the app on it, the app crashes, saying that it couldn't load the dependencies of that file.

Here is the file if you want to test it: https://www.mediafire.com/?nz9yct6i3wzn48b

I load it using

manager.load("failed.wav", Music.class);

Solution

  • I checked your file failed.wav, that sampled with 32-bits and it should be 16-bit sampled.

    so you can use audacity and easily convert filetype of your file.

    For Conversion :

    Import file into Audacity, then export and choose fileType WAV (Microsoft) signed 16-bit float PCM instead of WAV (Microsoft) 32-bit float PCM


    After conversion I tested your file with AssetManager on Desktop and Android, It's working fine on both target platform.