0

I have a mixer and I want to gather information on its source lines. My code is as follows.

myMixer = AudioSystem.getMixer(mixerInfo[i]); // index through all list of mixers
Line[] lines = myMixer.getSourceLines();
System.out.println(lines.length);

In the code, I cycle through every mixer on my computer and then I try to get a list of all the source lines. However none of the source lines are open to the mixer. How do I access these lines? System.out.println(lines.length) always prints 0.

Paul Bellora
  • 54,340
  • 18
  • 130
  • 181
Dr.Knowitall
  • 10,080
  • 23
  • 82
  • 133
  • See the [`MediaTypes`](http://stackoverflow.com/questions/7585699/list-of-useful-environment-settings-in-java/7616206#7616206) source on this thread for an overview. Note that Java Sound is hit and miss. It might be that machine does not register any microphones. – Andrew Thompson Jan 20 '13 at 00:06
  • I've noticed this. Java does not work consistently on other platforms. Windows works like a charm while linux is giving me problems. I haven't had the chance to test on Mac, however Mac is like linux so this makes me nervous. – Dr.Knowitall Jan 20 '13 at 00:24
  • Java Sound is about as unreliable on Mac. as on *nix. :( – Andrew Thompson Jan 20 '13 at 00:26
  • That's ironic since I began developing in Java since its a cross-platform language. Apparently its not that easy, at least it's free to develop with. – Dr.Knowitall Jan 20 '13 at 19:01

0 Answers0