...

Signature
Andrew Thompson
http://www.athompson.info/andrew/
I read the other threads about your project and tried running
audiotrace from exe and from source.
I hadn't hooked up my mike, and when I spoke into it I saw it on lines
1 and 2! Nothing playing on the speakers though appeared on the lines
even with show all lines on. I'm using xp pro 64. Perhaps it's my
soundcard. Here's what a list of mixers looks like:
Available Mixers:
Primary Sound Driver
Realtek HD Audio output
Primary Sound Capture Driver
Realtek HD Audio Input
Realtek HD Digital input
Java Sound Audio Engine
Port Realtek HD Audio output
Port Realtek HD Digital input
Port Realtek HD Audio Input
Here's AudioTrace's mixer info:
Mixer 0: Primary Sound Driver, version Unknown Version
Mixer 1: Realtek HD Audio output, version Unknown Version
Mixer 2: Primary Sound Capture Driver, version Unknown Version
Line 2/0: interface TargetDataLine supporting 8 audio formats, and
buffers of at least 32 bytes
frmt.: PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-
endian
Mixer 3: Realtek HD Audio Input, version Unknown Version
Line 3/0: interface TargetDataLine supporting 8 audio formats, and
buffers of at least 32 bytes
frmt.: PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-
endian
Mixer 4: Realtek HD Digital input, version Unknown Version
Line 4/0: interface TargetDataLine supporting 8 audio formats, and
buffers of at least 32 bytes
frmt.: PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-
endian
Mixer 5: Java Sound Audio Engine, version 1.0
Mixer 6: Port Realtek HD Audio output, version 5.10
Line 6/0: SPEAKER target port
Note: Is a Data line, but not a TDL
Mixer 7: Port Realtek HD Digital input, version 5.10
Mixer 8: Port Realtek HD Audio Input, version 5.10
Line 8/0: Recording Control target port
Note: Is a Data line, but not a TDL
Here's a more detailed examination of the Realtek HD Audio Input and
Audio Output mixers with line info and controls:
Found mixer: Port Realtek HD Audio Input
Port Mixer
Source Line Supported:
COMPACT_DISC, source
Available controls:
CD Volume Control containing Mute Controls.
Mute Control with current value: false
MICROPHONE, source
Available controls:
Mic Volume Control containing Mute Controls.
Mute Control with current value: false
LINE_IN, source
Available controls:
Line Volume Control containing Mute Controls.
Mute Control with current value: false
Stereo Mix, source
Available controls:
Stereo Mix Control containing Mute Controls.
Mute Control with current value: true
Target Line Supported:
Recording Control, taget
Available controls:
Volume with current value: 0.37421227 (range: 0.0 - 1.0)
Balance with current value: -3.2120983E-8 (range: -1.0 - 1.0)
Mute Control with current value: false
CD Volume Control containing Mute Controls.
Mute Control with current value: false
Mic Volume Control containing Mute Controls.
Mute Control with current value: false
Line Volume Control containing Mute Controls.
Mute Control with current value: false
Stereo Mix Control containing Mute Controls.
Mute Control with current value: true
mail.flacco@gmail.com - 28 Sep 2007 06:03 GMT
I realized I omitted some info: I'm only getting 3 lines showing up on
your program.
Also, I wrote the following program to see if I could get a valid
speaker port and record from it. The port was valid, but I can't
record. I assume that's because as a port the speaker is play only,
not record.
//////////////////////////////
import javax.sound.sampled.*;
import java.io.*;
public class Test {
public static void main(String args[])
{
Mixer.Info[] mixerInfo = AudioSystem.getMixerInfo();
AudioFormat audioFormat = new AudioFormat(
AudioFormat.Encoding.PCM_SIGNED,
44100.0F, 16, 2, 4, 44100.0F, false);
Port.Info portInfo = new Port.Info(TargetDataLine.class,
Port.Info.SPEAKER.getName(), false);
DataLine.Info dataLineInfo = new
DataLine.Info(portInfo.getLineClass(),
audioFormat);
Mixer mixer = AudioSystem.getMixer(mixerInfo[3]);
TargetDataLine targetDataLine = null;
try {
targetDataLine = (TargetDataLine)mixer.getLine(dataLineInfo);
targetDataLine.open(audioFormat);
} catch ( Exception e) { System.out.println("E: "+e); }
int numBytesAvailable = targetDataLine.available();
BufferedReader br = new BufferedReader(new
InputStreamReader(System.in));
String exitQ = null;
targetDataLine.start();
while(true) {
byte tempBuffer[] = new byte[10000];
targetDataLine.read(tempBuffer, 0, tempBuffer.length);
System.out.println(tempBuffer.toString());
System.out.println("# bytes available = "+numBytesAvailable);
try {
exitQ = br.readLine();
} catch (IOException ioe) {
System.out.println("IO error trying read exit code!");
System.exit(1);
}
if (exitQ.charAt(0)=='e') { System.out.println("Goodbye");
System.exit(1); } //type e to exit
}
}
}