Convert ogg/oga file to wav using Java

86 Views Asked by At

I have an ogg file downloaded from whatsapp. I am trying to convert it to wav. However, reading the input stream is failing with Unsupported format.

        File file = new File("audio.ogg");
        AudioInputStream in = AudioSystem.getAudioInputStream(file);

The exception:

Exception in thread "main" javax.sound.sampled.UnsupportedAudioFileException: File of unsupported format
        at java.desktop/javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1066)
        at org.Convert.main(Convert.java:20)

I added following dependency to no avail.

 <dependency>
    <groupId>com.googlecode.soundlibs</groupId>
    <artifactId>vorbisspi</artifactId>
    <version>1.0.3.3</version>
</dependency>

Thoughts?

0

There are 0 best solutions below