Port Access

Is this code any intialisation, Please help

In Java How can we control System Sound output. For Example if I am playing a sound clip

using AudioClip API and I want to control its volume and so other clips which are played next uses that volume to play.

The code:

Line.Info lines[] = AudioSystem.getTargetLineInfo(Port.Info.SPEAKER);

returns no lines.

Additionally, the code:

if (AudioSystem.isLineSupported(Port.Info.SPEAKER)) {

Port line = (Port)AudioSystem.getLine(Port.Info.SPEAKER);

}

else {

System.out.println("No speaker");

}

if (AudioSystem.isLineSupported(Port.Info.HEADPHONE)) {

Port line = (Port)AudioSystem.getLine(Port.Info.HEADPHONE);

}

else {

System.out.println("No headphone");

}

if (AudioSystem.isLineSupported(Port.Info.LINE_OUT)) {

Port line = (Port)AudioSystem.getLine(Port.Info.LINE_OUT);

}

else {

System.out.println("No LINE_OUT");

}

Tells me I have no speaker, no headphone, and no LINE_OUT. I clearly have

sound support on this computer.

Is there something I have to do first to initialize this stuff?

[1209 byte] By [dsubram] at [2007-9-26 7:41:50]
# 1

The bad news: Javasound doesn't implement Ports. (at least as of JDK 1.4 beta 2).

The good news: I've submitted a RFE. The bugID of the request to implement Ports is: 4504642. Please consider voting for it. Unless Javasoft hears that we need the features provided by Ports, it may never get done.

bhamail at 2007-7-1 17:47:08 > top of Java-index,Security,Cryptography...
# 2
The new bugID of the request to implement Ports is: 4558938. (If you voted for the old bug id: 4504642, be sure to change your votes to this new bug report since the old one was closed as a duplicate of the new one.)
bhamail at 2007-7-1 17:47:08 > top of Java-index,Security,Cryptography...