Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: mp3 file cant be resolved

  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy mp3 file cant be resolved

    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 ?


  2. #2
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default 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.

  3. #3
    Junior Member
    Join Date
    Oct 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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

  4. #4
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: mp3 file cant be resolved

    Quote Originally Posted by aNGaJe View Post
    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.

Similar Threads

  1. [SOLVED] This absolute uri (http://displaytag.sf.net) cannot be resolved in either web.xml or
    By santosh.dhulipala in forum JavaServer Pages: JSP & JSTL
    Replies: 3
    Last Post: October 4th, 2021, 09:58 AM
  2. Error: The import java.swing cannot be resolved [in drJava]
    By ArcticOokami in forum What's Wrong With My Code?
    Replies: 4
    Last Post: January 24th, 2012, 06:39 PM
  3. Highlighted words Not resolved
    By Rajiv in forum What's Wrong With My Code?
    Replies: 2
    Last Post: August 4th, 2011, 07:28 AM
  4. cannot be resolved to a type
    By Teraphim in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 16th, 2010, 10:42 AM
  5. Error msg : 'pageContext' cannot be resolved in tag file....
    By saikrishna436 in forum JavaServer Pages: JSP & JSTL
    Replies: 5
    Last Post: September 8th, 2009, 07:58 AM