mp3 file cant be resolved
Code :
import javax.media.*;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.net.MalformedURLException;
public class SimpleAudioPlayer {
private SimpleAudioPlayer audioPlayer = null;
public SimpleAudioPlayer(URL url) throws IOException,NoPlayerException,CannotRealizeException
{
this(file.toURL());
}
public void play ()
{
audioPlayer.start();
}
public void stop
{
audioPlayer.stop();
audioPlayer.close();
}
/**
* @param args
*/
public static void main(String[] args)
{
File audioFile = new File(args[0]);
SimpleAudioPlayer player = new SimpleAudioPlayer(audioFile);
player.play()
player.stop()
// TODO Auto-generated method stub
}
}
here i got my basic mp3 player's code
i m trying to complile it on ECLIPSE
and there is 6 eror that i really do not understand and cant fix :(
can any1 explain me how to fix ?
http://img526.imageshack.us/img526/3049/adszyij.jpg
Re: mp3 file cant be resolved
1. File cannot be resolved. It means that compiler can not find the class at the specified path. Check for all the opening and closing brackets. You might miss one.
2. Syntax error, inser ";" to complete Field Declaration. You have missed ; somewhere in SimpleAudioPlayer.java at line 19
3. The method close(), start(), stop() are undefined for the SimpleAudioPlayer, either extends your class from MediaPlayer class.
4. Function must have () in it's definition, calling and everything.
Re: mp3 file cant be resolved
thax for realy quick answer Mr.777;
all brackets are okay [i mean no missing barck.]
2. nothing changes when i add ";" at line 19
3. actually couldnt get how to use these close(), start(), stop() that means i have no idea to how to define them into SimpleAudioPlayer & Mediaplayer class
Re: mp3 file cant be resolved
Quote:
Originally Posted by
aNGaJe
thax for realy quick answer Mr.777;
all brackets are okay [i mean no missing barck.]
2. nothing changes when i add ";" at line 19
3. actually couldnt get how to use these close(), start(), stop() that means i have no idea to how to define them into SimpleAudioPlayer & Mediaplayer class
SimpleAudioPlayer is your defined and implemented class and they don't have close(), start() and stop() methods. And you try to call them by using the object of the same class. Try thinking and making the object of class that possesses these functions.
And this class is not complete. Post your complete code here to let everyone have a look over these.