I found a simple code of how to play an mp3 file (http://java-demos.blogspot.gr/2012/11/java-code-to-play-mp3-file.html). I installed the Java Media Framework as the instructions say but then I still get this from Eclipse "the import javax.media cannot be resolved" on the first line of import javax.media.*; Any ideas?
Asked
Active
Viewed 7,357 times
0
-
have you checked that it is definetly added to the classpath? – Theolodis Feb 05 '14 at 12:33
-
possible duplicate of [Eclipse missing imports (javax.media.\* and com.sun.media.\*)](http://stackoverflow.com/questions/16163524/eclipse-missing-imports-javax-media-and-com-sun-media) – Theolodis Feb 05 '14 at 12:34
-
Um truth is no. How can this be done? – Feb 05 '14 at 12:34
1 Answers
1
Here They solved that problem by rebuilding the project path in eclipse. You might want to try that.
-
Ok everything is ok now but when I run the code I get this: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at AudioPlay.main(AudioPlay.java:23) – Feb 05 '14 at 13:02
-
When you start the program you have to set the command argument to the path, where the mp3 is located. `File f=new File(args[0]);` In eclipse you can do that in the run configuration. – Theolodis Feb 05 '14 at 13:10