In Linux I was getting this error when using the Beads audio library:
Exception in thread "Thread-1" java.lang.IllegalArgumentException: Line unsupported: interface SourceDataLine supporting format PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, big-endian at java.desktop/com.sun.media.sound.PortMixer.getLine(PortMixer.java:131) at beads.JavaSoundAudioIO.create(Unknown Source) at beads.JavaSoundAudioIO$1.run(Unknown Source) at java.base/java.lang.Thread.run(Thread.java:844)
Since I didn’t find any help online about this but I made it work I thought I would share here how I did it.
The problem is that by default it chooses the wrong audio mixer. I fixed it with two steps.
JavaSoundAudioIO.printMixerInfo();to list the available mixers on the console.
- Look at the console and choose a mixer that it’s not the default one (0). Then I replace this line:
ac = new AudioContext();
with these three, in which I choose mixer 3 (my internal sound card):
JavaSoundAudioIO jsaIO = new JavaSoundAudioIO(); jsaIO.selectMixer(3); ac = new AudioContext(jsaIO);
Then it works fine.