Has anyone recently (like a few days) had fatal problem recording sounds with AudioRecorder?
I'm using it in a big project, it was working fine a few days ago but now nothing.
Even the example that comes with Processing "RecordingLineIn" is not working.
The problem is in the save method. I get the exception message
java.lang.IllegalArgumentException: invalid output index: output.length=163840 outByteOffset=2 sampleCount=40960 format=10: 16bit signed little endian
If run on Eclipse it gives more detail:
Exception in thread "Animation Thread" java.lang.IllegalArgumentException: invalid output index: output.length=163840 outByteOffset=2 sampleCount=40960 format=10: 16bit signed little endian
at org.tritonus.share.sampled.FloatSampleTools.float2byteGeneric(FloatSampleTools.java:629)
at org.tritonus.share.sampled.FloatSampleTools.float2byteGeneric(FloatSampleTools.java:590)
at org.tritonus.share.sampled.FloatSampleTools.float2byte(FloatSampleTools.java:509)
at org.tritonus.share.sampled.FloatSampleBuffer.convertToByteArray(FloatSampleBuffer.java:372)
at org.tritonus.share.sampled.FloatSampleBuffer.convertToByteArray(FloatSampleBuffer.java:388)
at ddf.minim.javasound.JSBufferedSampleRecorder.save(JSBufferedSampleRecorder.java:144)
at ddf.minim.AudioRecorder.save(AudioRecorder.java:107)
Also I'm running a Mac (might be important).
I really don't know what to do. I've run in with a similar problem when I was using a external microphone and I forgot to put batteries on it but now I using the internal one so I'm totally lost
The problem is sometimes the loadSnippet method returns null. I mean it behaves randomly, sometimes it works and sometimes not (with the same file).
I'm only using wav files recorded with the example about recording sound that comes with Processing.
Also maybe important to notice that I use 2 AudioSnippet objects one has always the same sound and is just played the other is used to load different sounds. Only the second one has problems.
Also important to notice that I'm using threads.
I went and digged into the code of Minim and the problem is on line 606 of JSMinim. When I call getInputStream a UnsupportedAudioFileException is triggered.