libgdx / gdx-video

A libGDX cross platform video rendering extension
Apache License 2.0
147 stars 50 forks source link

error with music in newst libgdx version #75

Closed jeltedeproft closed 2 years ago

jeltedeproft commented 2 years ago

Getting this error on libgdx version 1.11, the RawMusic class uses OpenALLwjglAudio, but I think libgdx expects OpenALLwjgl3Audio

java.lang.ClassCastException: class com.badlogic.gdx.backends.lwjgl3.audio.OpenALLwjgl3Audio cannot be cast to class com.badlogic.gdx.backends.lwjgl.audio.OpenALLwjglAudio (com.badlogic.gdx.backends.lwjgl3.audio.OpenALLwjgl3Audio and com.badlogic.gdx.backends.lwjgl.audio.OpenALLwjglAudio are in unnamed module of loader 'app') at com.badlogic.gdx.video.RawMusic.<init>(RawMusic.java:33) at com.badlogic.gdx.video.VideoPlayerDesktop.createMusic(VideoPlayerDesktop.java:26) at com.badlogic.gdx.video.CommonVideoPlayerDesktop.play(CommonVideoPlayerDesktop.java:95) at com.jelte.myGames.Ponko.visual.PonkoScreen.<init>(PonkoScreen.java:57) at com.jelte.myGames.Ponko.visual.VisualManager.initialize(VisualManager.java:17) at com.jelte.myGames.Ponko.Ponko.create(Ponko.java:31) at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.initializeListener(Lwjgl3Window.java:416) at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update(Lwjgl3Window.java:366) at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop(Lwjgl3Application.java:192) at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:166) at com.jelte.myGames.lwjgl3.Lwjgl3Launcher.createApplication(Lwjgl3Launcher.java:14) at com.jelte.myGames.lwjgl3.Lwjgl3Launcher.main(Lwjgl3Launcher.java:10)

crykn commented 2 years ago

You probably included the wrong desktop dependency. Try changing implementation "com.badlogicgames.gdx-video:gdx-video-lwjgl:1.3.2-SNAPSHOT" to implementation "com.badlogicgames.gdx-video:gdx-video-lwjgl3:1.3.2-SNAPSHOT" in your build.gradle file.

jeltedeproft commented 2 years ago

yeah you are right, my bad! That was indeed the problem