久一网络科技

久一网络科技是您快速建站的首选,我们提供快速高效的服务:快速建站,服务器运维,整站建设,网络编程,网络安全等。持久的品质保证,始终如一的服务理念,久一网络科技-----您身边的网络专家。 如有需求,请联系:tech@jooyee.net

import java.io.IOException;
import java.io.InputStream;
import javax.microedition.media.Manager;
import javax.microedition.media.MediaException;
import javax.microedition.media.Player;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;


public class MyWavMidlet extends MIDlet
{
Player player;

public MyWavMidlet()
{
super();
try
{
InputStream is=this.getClass().getResourceAsStream("/OKSOUND.WAV");
player=Manager.createPlayer(is, "audio/x-wav");
}
catch(IOException e){}
catch(MediaException e){}
}

// TODO Auto-generated constructor stub


protected void destroyApp(boolean arg0) throws MIDletStateChangeException
{
// TODO Auto-generated method stub

}

protected void pauseApp()
{
// TODO Auto-generated method stub

}

protected void startApp() throws MIDletStateChangeException
{
try
{
player.start();
}
catch(MediaException e){}

}
}

0 评论 ---->點閱數:

发表评论

关注者

热门帖子

网页浏览总次数