Hi, the code below will help you get more knowledge about the Player clas and also about the use of it. So, I think you will come to know how to use the player class in your program. Use it.
Code:
import javax.microedition.midlet.MIDlet;
import javax.microedition.media.*;
public class soundclass extends MIDlet
{
public void startApp()
{
try
{
Player pl = Manager.createPlayer(getClass().
getResourceAsStream("/CatBird.wav"),"audio/x-wav");
pl.start();
}
catch(Exception e)
{
e.printStackTrace();
}
}
public void pauseApp()
{
}
public void destroyApp(boolean unconditional)
{
}
}
Bookmarks