I set up JMF using this tutorial http://www.deitel.com/articles/java_tutorials/20060422/PlayingVideowithJMF/ . I set up the mp3 codec in the jmfregistry like you are suppose to and I am able to play any mp3 I want when I use jmstudio. This means I set up everything correctly but when I execute my code I still get this error message:
Unable to handle format: mpeglayer3, 44100.0 Hz, 16-bit, Stereo, LittleEndian, Signed, 16000.0 frame rate, FrameSize=32768 bits Failed to realize: com.sun.media.PlaybackEngine@5c3987 Error: Unable to realize com.sun.media.PlaybackEngine@5c3987
I play the same exact mp3 with the jmstudio and it works fine. What could be wrong? My very simple code below shows what I am doing. Any help is appreciated.
public class MediaPanel{
public static void main (String args[]){
try{
Player myMp3File = Manager.createPlayer(new File("test2.mp3").toURI().toURL());
myMp3File.start();
}catch(Exception e){
e.printStackTrace();
}
}
}