Hello!
I'm trying to record voice sample and I've got a problem with my .wav format. With:
AudioFormat format = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 44100.0F, 16, 1, 2, 44100.0F, false);
everything works fine. But what I need (because of further analysis of this audio file in Matlab) is PCM_FLOAT format:
AudioFormat format = new AudioFormat(AudioFormat.Encoding.PCM_FLOAT, 8000.0F, 32, 1, 4, 8000.0F, true);
which unfortunately returns an error:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException:
No line matching interface TargetDataLine supporting format PCM_FLOAT 8000.0 Hz, 32 bit, mono, 4 bytes/frame, is supported.
I've tried a lot of different combinations with PCM_FLOAT but every one of them returns same exception. I'm probably missing something but the question is: what? How can I find what audio formats could work with my sound card? If I can only use PCM_SIGNED or
UNSIGNED how can I convert recorded .wav file to PCMFLOAT?