DV8FromTheWorld / JDA-Player

Extension library for JDA (or D4J) that provides an Java wrapping of Youtube-dl, FFmpeg and FFprobe for use as an AudioProvider.
Apache License 2.0
14 stars 5 forks source link

AudioPlayer cannot be cast to main.MusicPlayer #12

Closed robot-rover closed 8 years ago

robot-rover commented 8 years ago

Issue: When trying to play a youtube link, I get the error: 20:23:00.705 [Event Dispatch Thread] ERROR s.b.d.Discord4J - Unhandled exception caught dispatching event MessageReceivedEvent java.lang.ClassCastException: sx.blah.discord.util.audio.AudioPlayer cannot be cast to main.MusicPlayer It worked just a few days ago and I haven't changed any code and I haven't updated JDA player. It could be due to me updating to D4J 2.5.3.

Expected Outcome: Youtube Plays through voice without throwing exception

Actual Outcome: Throws exception and does not play

Full Stacktrace: http://hastebin.com/ukebudecew.avrasm

DV8FromTheWorld commented 8 years ago

I'm uh. I'm kinda confused here. sx.blah.discord.util.audio.AudioPlayer nor main.MusicPlayer are D4J-Player code.

Am I missing something here?

robot-rover commented 8 years ago

The music player is the code from the d4j player example. I'm just trying to figure out why or how it stopped working as I didn't change anything in my code. If this is the wrong place to ask then my apologies.

DV8FromTheWorld commented 8 years ago

This is the correct place for JDA-Player/D4J-Player issues. The thing I'm confused about is the fact that it says main.MusicPlayer instead of net.dv8tion.d4j.player.MusicPlayer

Are you just copying the code directly from the repo instead of using the compiled jar / Maven / Gradle?

Either way: The MusicPlayer class provided by D4J-Player is not an implementation of D4J's AudioPlayer. It is an implementation of D4J's AudioProvider.

robot-rover commented 8 years ago

I copied the code directly because I didn't realize that the examples where provided in the maven repository. I will change that

robot-rover commented 8 years ago

I switched from my copy pasted music player to importing one from the maven repository and now it works fine ¯\_(ツ)_/¯ Thanks for your help DV8

DV8FromTheWorld commented 8 years ago

Awesome, glad it worked :+1: