0
import javax.media.*;
import java.io.*;

public class MP3Player {

    public static void main(String[] args) throws Exception {
       File file = new File("xyz.mp3");
       MediaLocator mrl = new MediaLocator(file.toURL());
       Player player = Manager.createPlayer(mrl);
       player.start();
    }

}


    }``

when i execute above program, it shows error :
Failed to configure: com.sun.media.PlaybackEngine@ce124a7
Bad header in the media: Couldn't detect stream type
Error: Unable to realize com.sun.media.PlaybackEngine@ce124a7 )
.
Any explaination for the above error ??

3
Contributors
2
Replies
14
Views
3 Years
Discussion Span
Last Post by JamesCherrill
0

is that JMF code?
does look so like me. if it is, dump it. JMF is very outdated and hasn't been maintained for over years. there are better and more efficiënt ways to play mp3 files these days.

also: never allow your main method to throw Exceptions. nothing good can come from it.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.