Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Play Mp3 in java  RSS feed

 
Gavin Bonner
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i am currently trying to use javazoom to play mp3 files. So far i have an MP3 file playing using:
import java.io.*;
import javazoom.jl.player.Player;
import javazoom.jl.decoder.JavaLayerException;
public class PlayMP3
{
public static void main(String args[])
{
try
{
InputStream in = new
FileInputStream("Demo.mp3");
Player clip = new Player(in);
clip.play();
/**Problem here below**/
clip.close();
}
catch(JavaLayerException e1)
{
System.out.println("mp3error!!!");
}
catch(IOException e)
{
System.out.println("file error");
}
}
Problem 1: this will play "Demo.mp3" in the command prompt but it does not reach the clip.close command.
Problem 2: i did not see any functionality on the doc. for fast-forward/rewind. Can it be done with javazoom?
Cheers
Gavin
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Other Java APIs forum...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!