javaraspberry-piraspberry-pi3jlayer

Java jlayer on RasberryPi


I am making a music player for rasberry pi. There is a hifiberry module connected to it. I am using a jlayer library for playing music. When i run the code on my PC (Ubuntu) it works fine, but when i try to run it on the rasberry, i dont get any error, but there is no sound playing. I tried reinstalling java. It does not work even without the module.

I am using this piece of code:

public class Main {
    public static void main(String[] args) {
            AdvancedPlayer player = new AdvancedPlayer(new FileInputStream(args[0]));
            player.play();
    }
}

Is there any solution for this? or can u suggest any library that could work, which supports mp3 files?


Solution

  • Somehow the audio was streaming to bad output, and i could not find a way to change the output port, so i used a mp3spi library, which i managed to get working.