J2ME Code to play Mp3

Post date: Aug 19, 2009 4:45:04 AM

public void run()
{
  try
  {
    InputStream is = getClass().getResourceAsStream("/your.mp3");
    player = Manager.createPlayer(is,"audio/mpeg");

player.realize();

// get volume control for player and set volume to max

vc = (VolumeControl) player.getControl("VolumeControl");

if(vc != null)

{

vc.setLevel(100);

}

player.prefetch();

player.start();

}

catch(Exception e)

{}

}