doesn't work on ios-moe


The application crash when I set the volume of the sound, it happens only at iOS-moe, and it is working find on other OS. Appreciate if anyone could advise…

*** Terminating app due to uncaught exception ‘java.lang.ClassCastException’, reason: 'java.lang.ClassCastException: apple.NSObject cannot be cast to com.badlogic.gdx.backends.iosmoe.objectal.ALSource
at com.badlogic.gdx.backends.iosmoe.IOSSound.getSoundSource(
at com.badlogic.gdx.backends.iosmoe.IOSSound.setVolume(

*** snippet:
sound.setVolume(ID.SOUND.ordinal(), 0.0f);

Best regards,


Which libgdx version did you use?
I tried with libgdx 1.9.7-SNAPSHOT version, this code and worked fine :

        FileHandle fh = Gdx.files.internal("alarm.mp3");
        IOSSound iosSound = new IOSSound(fh);
        long id =;
        iosSound.setVolume(id, 0.0f);

Best regards,

Hi Roland,

Ahh, I am using gdxVersion 1.9.5… However, added a try / catch resolved the problem. Anyway, thanks and I will update to 1.9.7-SNAPSHOT.

Best regards,