I have the following code:
String fileName="D:/downloads/song.mp3";
File soundFile = new File(fileName);
AudioInputStream audioInputStream = null;
try {
audioInputStream = AudioSystem.getAudioInputStream(soundFile);
} catch (Exception ex) {
ex.printStackTrace();
}
But the code raises the following exception:
javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input file
How can I solve this problem?