简体   繁体   中英

How to start atop audio in J2ME

I want to add audio to an application. I have added audio, but the problem is that the audio does not stop till the audio clip is over.

How do I make it stop?

If you are using Player interface from javax.microedition.media package. You can just call stop method of it. Please see Manager class documentation from MIDP API document.

try {
     Player p = Manager.createPlayer("http://myhost/abc.wav");
     p.start();
     p.stop();
 } catch (MediaException pe) {
 } catch (IOException ioe) {
 }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM