I am trying to record / process some sound from three USB microphones using Java Sound on Snow Leopard (but can switch to Windows if it fixes everything). The problem is that when I try to use a mixer that matches the usb microphone, Java Sound tells me that the line is not supported. In particular, this speaks of this ...
Available faucets:
Java Sound Audio Engine
USBMIC Serial # 041270067
Built-in built-in microphone input
Soundflower (2ch)
Soundflower (16ch)
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: String is not supported: interface TargetDataLine support format PCM_SIGNED 96000.0 Hz, 8 bits, stereo, 2 bytes / frame,
... when I ask to choose a USBMIC mixer:
Mixer mixer = AudioSystem. getMixer(mixerInfo[1]);
I tried to match the audio format with the exact characteristics of the microphones (16 bit, 44100 Hz, stereo), and it did not matter.
The problem arises here:
final TargetDataLine line = (TargetDataLine) mixer.getLine(info);
It would seem that the mixer and TargetDataLine do not like each other. Is there a way to make these two play and get along?
The microphones that I use are admittedly a bit weird. They were made for use in a karaoke video game called SingStar. The microphones themselves have standard mono-linear connectors that connect to a small hub (from two to a hub) that converts them into one male USB connector. Strange aside, however, they seem to work fine with Audacity as separate channels, so multi-channel recording with them is clearly possible, maybe not in Java.
I also considered using a program such as Soundflower, which shares sound between different programs. However, I am not sure if this will work, as I cannot figure out how to make the USB microphone inputs in Soundflower, and then connect them to Java. A quick experiment showed me that I can record audio in Audacity from microphones, stream it through Soundflower, and then process it in my Java program. However, I would like all this to happen in real time in Java.
Is anyone familiar with this problem?