I am having trouble in converting the audio format of a WAV file.
I am recording sound from my microphone and the sound is recorded in the following format: PCM_SIGN
Did you take a look at the documentation?
Throws: IllegalArgumentException - if the conversion is not supported #see #getTargetEncodings(AudioFormat)
Not every system will have sufficient codecs installed to transform to the specific format you've asked for. You've assumed yours does, but it's throwing the exception because it can't transform to that format.
You can use getTargetEncodings to check the suitability of a given format programatically, without relying on an exception, and then can take appropriate action if you desired output format isn't available (e.g. fall back to another one, present the user with feedback that this is impossible, etc.).