I need to convert wav file from FORMAT 1 to FORMAT 2
Format 1 : μ-law, 8000Hz, 64 kbps, mono
FORMAT 2 : Container WAV Encoding PCM Rate 16K Sample Format 16 bit Channels Mono
Following is the Code snippet :
File file = new File("audio_before_conversion.wav");
AudioFormat audioFormat = new AudioFormat(16000, 16, 1, true , true);
AudioInputStream audioInputStream1 = new AudioInputStream(
new FileInputStream(file), audioFormat, numFrames);
AudioSystem.write(audioInputStream1, Type.WAVE,
new File("audio_after_conversion.wav"));
Issue : But, this is not working. It playing some noise and also reducing my audio file length.
Edit 1: mu-Law to μ-law