The implementation of Java Sound currently constrains the number of
audio output devices to 1, even if multiple audio output devices are
available on the machine. Java Sound should detect and allow utilization
of any of the installed audio output devices. The following mail describes
the problem.
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Url: http://www.media.mit.edu/~ckline/
Date: Fri, 3 Sep 1999 12:51:08 -0400
Comments: Resent-From: Christopher Kline <###@###.###>
Comments: Originally-From: Christopher Kline <###@###.###>
From: Christopher Kline <###@###.###>
Subject: [JAVASOUND] Is 8-channel output possible in the Java Sound API?
To: ###@###.###
Hello,
I'm trying to use the version of Java Sound included in the JDK 1.3
beta release with the 16-channel Sonorus STUDI/O card. In my NT4.0
system, I can play to any of the 8 stereo output channels using the
standard audio program WinAmp, so I know the card is working.
I have written the following test code:
------------------------------------------------------------
import java.io.*;
import javax.media.sound.*;
import javax.media.sound.midi.*;
import javax.media.sound.sampled.*;
import java.util.*;
public class TestJavaSound
{
public static void main(String args[])
{
NBasicSoundServer server = new NBasicSoundServer();
Mixer.Info[] mixerInfo = AudioSystem.getMixerInfo();
System.err.println("\nMixer info length = " +
mixerInfo.length + " records");
for (int i = 0; i < mixerInfo.length; i++)
{
System.err.println("\nMIXER " + i + ": " + mixerInfo[i]);
Mixer m = AudioSystem.getMixer(mixerInfo[i]);
Line.Info[] sourceInfo = m.getSourceLineInfo();
for (int j = 0; j < sourceInfo.length; j++)
{
System.err.println("\tOUTPUT LINE " + j + ": " + sourceInfo[j]);
}
Line.Info[] targetInfo = m.getTargetLineInfo();
for (int j = 0; j < targetInfo.length; j++)
{
System.err.println("\tINPUT LINE " + j + ": " + targetInfo[j]);
}
}
System.err.println("\nDone");
}
}
------------------------------------------------------------
When I run the code, I get the following output:
------------------------------------------------------------
Mixer info length = 11 records
MIXER 0: Java Sound Audio Engine, version 1.0
OUTPUT LINE 0: Line of class interface javax.media.sound.sampled.SourceDataLine Source for Mixer com.sun.media.sound.HeadspaceMixer@2bbd86 with 8 formats and buffer size 0 to NOT_SPECIFIED
OUTPUT LINE 1: Line of class interface javax.media.sound.sampled.Clip Source for Mixer com.sun.media.sound.HeadspaceMixer@2bbd86 with 8 formats and buffer size 0 to NOT_SPECIFIED
OUTPUT LINE 2: Line of class interface javax.media.sound.sampled.GroupLine Source for Mixer com.sun.media.sound.HeadspaceMixer@2bbd86
INPUT LINE 0: Line of class interface javax.media.sound.sampled.DataLine Target for Mixer com.sun.media.sound.HeadspaceMixer@2bbd86 with 24 formats and buffer size NOT_SPECIFIED to NOT_SPECIFIED
MIXER 1: icrosoft Sound Mapper, version nknown Version
INPUT LINE 0: Line of class interface javax.media.sound.sampled.TargetDataLine Target for Mixer com.sun.media.sound.SimpleInputDevice@5f6ccd with 32 formats and buffer size NOT_SPECIFIED to NOT_SPECIFIED
MIXER 2: onorus STUDI/O 1 In1, version nknown Version
INPUT LINE 0: Line of class interface javax.media.sound.sampled.TargetDataLine Target for Mixer com.sun.media.sound.SimpleInputDevice@601bb1 with 32 formats and buffer size NOT_SPECIFIED to NOT_SPECIFIED
MIXER 3: onorus STUDI/O 1 In2, version nknown Version
INPUT LINE 0: Line of class interface javax.media.sound.sampled.TargetDataLine Target for Mixer com.sun.media.sound.SimpleInputDevice@3a34f2 with 32 formats and buffer size NOT_SPECIFIED to NOT_SPECIFIED
MIXER 4: onorus STUDI/O 1 In3, version nknown Version
INPUT LINE 0: Line of class interface javax.media.sound.sampled.TargetDataLine Target for Mixer com.sun.media.sound.SimpleInputDevice@6a2dfe with 32 formats and buffer size NOT_SPECIFIED to NOT_SPECIFIED
MIXER 5: onorus STUDI/O 1 In4, version nknown Version
INPUT LINE 0: Line of class interface javax.media.sound.sampled.TargetDataLine Target for Mixer com.sun.media.sound.SimpleInputDevice@7182c1 with 32 formats and buffer size NOT_SPECIFIED to NOT_SPECIFIED
MIXER 6: onorus STUDI/O 1 In5, version nknown Version
INPUT LINE 0: Line of class interface javax.media.sound.sampled.TargetDataLine Target for Mixer com.sun.media.sound.SimpleInputDevice@3f5d07 with 32 formats and buffer size NOT_SPECIFIED to NOT_SPECIFIED
MIXER 7: onorus STUDI/O 1 In6, version nknown Version
INPUT LINE 0: Line of class interface javax.media.sound.sampled.TargetDataLine Target for Mixer com.sun.media.sound.SimpleInputDevice@74a24a with 32 formats and buffer size NOT_SPECIFIED to NOT_SPECIFIED
MIXER 8: onorus STUDI/O 1 In7, version nknown Version
INPUT LINE 0: Line of class interface javax.media.sound.sampled.TargetDataLine Target for Mixer com.sun.media.sound.SimpleInputDevice@4ac268 with 32 formats and buffer size NOT_SPECIFIED to NOT_SPECIFIED
MIXER 9: onorus STUDI/O 1 In8, version nknown Version
INPUT LINE 0: Line of class interface javax.media.sound.sampled.TargetDataLine Target for Mixer com.sun.media.sound.SimpleInputDevice@216869 with 32 formats and buffer size NOT_SPECIFIED to NOT_SPECIFIED
MIXER 10: inOS,waveOut,multi threaded, version nknown Version
OUTPUT LINE 0: Line of class interface javax.media.sound.sampled.SourceDataLine Source for Mixer com.sun.media.sound.SimpleOutputDevice@4de100 with 32 formats and buffer size NOT_SPECIFIED to NOT_SPECIFIED
Done
------------------------------------------------------------
Notice that only the TargetLines (representing audio input into the
card) show up --- no output channels appear. Does anyone know why this
is happening, or how to send a specific Clip to one of the 8 different
channels?
Is this even supported by the Java Sound API at this time?
thanks!
chris