MP3 player, play button has no sound

I am trying to get the mp3 play button for working with JLayer. I do not get errors, but the sound does not play. I added all the necessary jar files to the library and followed many tutorials, so the code should work, but I just don't get any sound. (P / S: I don't have an mp3 plugin)

try
{
    JOptionPane.showMessageDialog(null,"Trying");
    FIS = new FileInputStream("C:\\Users\\Jun\\Documents\\NetBeansProjects\\Player\\src\\Songs\\NumaNuma.mp3");
    BIS = new BufferedInputStream(FIS);

    playSong = new javazoom.jl.player.Player(BIS);
    playSong.play();
}
catch(FileNotFoundException | JavaLayerException e)
{
    JOptionPane.showMessageDialog(null,"Error Occured " + e);
}

new Thread()
{
    @Override
    public void run()
    {
        try 
        {
            playSong.play();
        } 
        catch (JavaLayerException ex) {
            JOptionPane.showMessageDialog(null,"Error Occured " + ex);
        }
    }
}.start();
+4
source share
1 answer

Now the player is working. I tried to play mp4, which I renamed to mp3, not fully understanding that this would not work until I used a real mp3 song.

0
source

Source: https://habr.com/ru/post/1629152/


All Articles