• 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
 
Humans and their filthy friendship brings nothing but trouble. My only solace is this tiny ad:
ScroogeXHTML 7.1 - RTF to HTML5 / XHTML converter
https://coderanch.com/t/690611/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!