Package javax.microedition.media

Examples of javax.microedition.media.Player.start()


    private void playSoundFile(String file) {
        try {
            InputStream is = getClass().getResourceAsStream(file);
            Player p = Manager.createPlayer(is, "audio/x-wav");
            p.start();
        } catch (Exception e) {
            //#ifdef debug
            Alert a = new Alert("Exception", e.toString(), null, AlertType.INFO);
            a.setTimeout(Alert.FOREVER);
            display.setCurrent(a);
View Full Code Here


            }
        }

        if (player != null) {
            try {
                player.start();
            } catch (final Exception e) {
                throw new MediaActionException("unable start player: " + e);
            }
        }
        return true;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.