This week's book giveaway is in the iOS forum.
We're giving away four copies of Classic Computer Science Problems in Swift and have David Kopec on-line!
See this thread for details.
Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

unable to playback .mp3 file in WTK.  RSS feed

 
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
Boost this thread!