1 2 Previous Next 15 Replies Latest reply on Aug 8, 2011 3:59 PM by captfoss

    How to use AudioSystem that reports no TargetDataLines, only Target Ports?

      I've sent a prototype to a friend to test on his machine. He's tested it on a Dell Windows laptop and another Dell Windows desktop. The laptop is one year old and the desktop is two years old. The prototype (which is "listening" to audio being played on the machine) won't function, so I've written a simple diagnostic tool that queries the AudioSystem to determine the hardware configuration as exposed through Java sound.

      The diagnostics tool reports the following:

      0 (none) Source Ports
      1 Target Port
      2 SourceDataLines
      0 (none) TargetDataLines

      The way that I've been "listening" to audio is through TargetDataLine.open() and TargetDataLine.read(). With no TDL at all on the system, how can I do this? I first thought that these must be old and/or unusual systems, but they are both mainstream, current Dell systems. It seems I'm completely missing the boad on this.

      The diagnostic code is really very simple. It is (mostly) this:
                Line.Info portInfo = new Line.Info(Port.class);
                Line.Info[] lineInfoAr = AudioSystem.getSourceLineInfo(portInfo);
                lineInfoAr = AudioSystem.getTargetLineInfo(portInfo);
                Line.Info tdlInfo = new Line.Info(TargetDataLine.class);
                lineInfoAr = AudioSystem.getSourceLineInfo(tdlInfo);
                lineInfoAr = AudioSystem.getTargetLineInfo(tdlInfo);
      Much appreciation to anyone that can point me towards the correct way to query and/or use a system like this. Thanks.

      Edited by: ags on Jul 5, 2011 1:56 PM (made title a question)
        1 2 Previous Next