I use JavaFlacEncoder 0.3.1
My hardware is Lenovo T430.
My Java version is 1.7
I attach my file. When I run it to capturing and save to FLAC file, it will appear Exception as below:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 16384
at javaFlacEncoder.AudioStreamEncoder.encodeAudioInputStream(AudioStreamEncoder.java:81)
at javaFlacEncoder.FLACFileWriter.write(FLACFileWriter.java:117)
at javax.sound.sampled.AudioSystem.write(Unknown Source)
at uzoo.soundlesson.GetSoundResource.testCapture(GetSoundResource.java:171)
at uzoo.soundlesson.GetSoundResource.main(GetSoundResource.java:182)
I have no idea at where my code is wrong.
However, if execusting the below code,it works:
FLAC_FileEncoder flacEncoder = new FLAC_FileEncoder();
File inputFile = new File("somefile.wav");
File outputFile = new File("test.flac");
flacEncoder.encode(inputFile, outputFile);
Thank you for your help.
There's a bug in the handling of big-endian in the encoder. Use little-endian instead if possible and it should work.