Results 1 to 2 of 2
  1. #1
    shruts is offline Member
    Join Date
    Jul 2011
    Posts
    12
    Rep Power
    0

    Default the mp3 file is not working..java.io.IOException: File Not Found......javax.media.NoP

    import java.applet.Applet;
    import java.awt.Button;
    import java.awt.Component;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.net.URL;

    import javax.media.ControllerEvent;
    import javax.media.ControllerListener;
    import javax.media.Manager;
    import javax.media.Player;

    public class LoadSoundApplet extends Applet implements ActionListener, ControllerListener{

    Button play, stop;
    private Player player;
    private static final String PLAY = "PLAY";
    private static final String STOP = "STOP";

    @Override
    public void init(){
    play = new Button();
    play.setLabel(PLAY);
    play.setActionCommand(PLAY);
    play.addActionListener(this);
    add(play);

    stop = new Button();
    stop.setLabel(STOP);
    stop.setActionCommand(STOP);
    stop.addActionListener(this);
    add(stop);

    }

    @Override
    public void actionPerformed(ActionEvent e) {

    if(e.getActionCommand().equals(PLAY)){

    try{

    player = Manager.createPlayer(new URL(getCodeBase(),"Ishq.mp3"));
    player.addControllerListener(this);

    player.start();

    }
    catch(Exception ex){
    ex.printStackTrace();
    }

    }else if(e.getActionCommand().equals(STOP)){
    player.stop();
    }else{
    player.stop();
    }

    }

    @Override
    public void controllerUpdate(ControllerEvent c) {
    // TODO Auto-generated method stub
    if(player == null)
    return;

    }




    }

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,815
    Rep Power
    25

    Default

    .java.io.IOException: File Not Found.
    What file is not found? Please post the full text of the error message.

Similar Threads

  1. Replies: 5
    Last Post: 11-22-2009, 05:48 PM
  2. how to use javax.media.jai.Interpolation
    By MINGxDOG in forum Java 2D
    Replies: 0
    Last Post: 11-16-2009, 09:01 PM
  3. Replies: 0
    Last Post: 11-04-2009, 10:09 PM
  4. javax.media.j3d.IllegalRenderingStateException
    By fred in forum Advanced Java
    Replies: 1
    Last Post: 07-24-2007, 02:53 AM
  5. javax.media library
    By Heather in forum Eclipse
    Replies: 1
    Last Post: 07-08-2007, 01:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •