Reputation: 43
I am trying to convert mp3 to wav file and I need the below lines of code to be able to proceed with the conversion post opening the mp3 file, however I get error -
AudioFileFormat inputFileFormat = AudioSystem.getAudioFileFormat(new File("C:/dg.mp3"));
AudioInputStream ais = AudioSystem.getAudioInputStream(new File("C:/dg.mp3"));
Error:
javax.sound.sampled.UnsupportedAudioFileException: file is not a supported file type at javax.sound.sampled.AudioSystem.getAudioFileFormat(Unknown Source) at MP3toWav.main(MP3toWav.java:10)
Any help on this is appreciated? I have searched a lot but unable to get any answers for my problem!
Upvotes: 1
Views: 3597
Reputation: 1
With default Java API you can only open .aiff
, .au
or .wav
files. You could try to convert your .mp3
to a .wav
file and then use your new .wav
file.
Upvotes: 0