In the Java Sound API, they gouge AudioSystem.getAudioInputStream which will return an AudioInputStream which will show you how to open the form of audio files in Java. It’s good enough to read WAV files, but not quite so for mp3.
. getAudioFormat , / .. (Swing, AWT, png ..).