• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JMF - Playing .m2a or .m2v file

swethaD deshmukh
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone help me in playing .m2a or .m2v file using JMF.I'm able to play .mpg and .mp3 but not .m2a and .m2v files.

I have installed JMF2.1.1e and Fobs4JMF.

I just started working on it so please can anyone help me regarding this.

Code ....

import java.io.File;
import java.io.IOException;
import javax.media.Time;
import javax.media.Player;
import javax.media.Manager;
import javax.media.NoPlayerException;

class MyMP3Player {

public static void main(String [] args) {
try {
File mp3File = new File("hnd03383.m2a");
System.out.println("mp3File "+mp3File);
Player aPlayer = Manager.createPlayer(mp3File.toURL());
aPlayer.start(); // Starts asynchronous playback
Thread.sleep(100*1000); // Allow playback to continue for 10
aPlayer.stop(); // stops playback (well, it really PAUSES!!!)
catch (IOException e) {e.printStackTrace();}
catch (NoPlayerException npe) {npe.printStackTrace();}
catch (InterruptedException ie) {ie.printStackTrace();}

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic