I have a few questions related to Sun, Audio-player and Sound Input/Output
Why is the sun.audio.AudioPlayer
package not part of the Java API? Some info
Like other sun.*
packages, it is undocumented and it might disappear.
It's an optional package, not part of the SE and hasn't been updated in a long time. Oracle has a page on it and it's still available but, well, who knows what will happen to it.
This is the current Java sound implementation, it is part of the SE and the tutorial for it can be found here. If you want to use audio in Java this is what you should learn because it's official, it works, it gets updated sometimes and it is well-documented.
Why is that? Despite being ubiquitous in file systems, mp3 has a history of licensing and patent issues. Mp3 is a minefield and this may be why Sun/Oracle has not put effort in to supporting it. (If this is why, I don't blame them.)
If you really want to play mp3 there are some third-party decoders floating around on the web. There is no point in recommending one because all of them will read mp3.
Use a javafx.scene.media.MediaPlayer. See javafx.scene.media/Supported Media Types. JavaFX is part of the JRE/JDK as of Java 8 (and new versions of Java 7) and will (probably) eventually supersede several SE APIs like javax.sound
and javax.swing
.