//我正在尝试使用 java 连接一个 mp3 文件列表。但是当我运行代码时,出现以下错误:
//javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input file
at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1170)
at soundConcat.main(soundConcat.java:42)
//这是代码
String[] strFilename = {"a","b","c","d","e","f"};
for (int i = 0; i < 6; i++)
{
File soundFile = new File("./sounds/"+strFilename[i]+".mp3");
AudioInputStream audioInputStream = null;
try
{
//getting an error on the next line
audioInputStream = AudioSystem.getAudioInputStream(soundFile);
}
catch (Exception e)
{
e.printStackTrace();
}
//some more operations here
}
}