Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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

845492Jul 3 2011 — edited Aug 8 2011
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)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 5 2011
Added on Jul 3 2011
15 comments
7,001 views