• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unable to playback .mp3 file in WTK.

 
chetan dhewal
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to play the mp3 file in SUN WTK 2.1... I am unable to do so. I am able to play only the .wav and .midi files.
I am using only the media API in the MIDP , i m not using the MM API.

heres the code
------------------------------

public class m4 extends MIDlet
{
public m4()
{
}


public void startApp()
{
try
{

InputStream is=getClass().getResourceAsStream("a.mp3");
Player p = Manager.createPlayer(is,"audio/mpeg");
p.realize();
p.prefetch();
p.start();

}
catch(Exception e)
{
}

}

public void pauseApp()
{
}

public void destroyApp(boolean x)
{
}

}
------------------------------


Thnx
Chetan Dhewal
SCJP 1.2
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic