This worked for me.
You can convert by applying AudioSystem.getAudioInputStream to an AudioInputStream object, and you get another AudioInputStream as the result. Here is the sample code of the part:
AudioInputStream inStream = AudioSystem.getAudioInputStream(soundFile); AudioFormat outDataFormat = new AudioFormat(8000.0f, 16, 1, 2, true, false); AudioInputStream outStream = AudioSystem.getAudioInputStream(outDataFormat, inStream);
In order to make above code work, we need following two extensions. Without these extensions, we get exception on the execution above.
http://www.tritonus.org/tritonus_share-0.3.6.jar http://www.tritonus.org/tritonus_remaining-0.3.6.jar