<Sound Dev> Great work on the Java Sound API for Linux!
cyberGn0m
cy6ergn0m at gmail.com
Sat Nov 7 14:01:13 PST 2009
Do you mean that you can play sound with another non-Java applications in
the same time? With Sun's JDK 1.6.0u16 i can't do it:
Exception in thread "main" javax.sound.sampled.LineUnavailableException:
Audio Device Unavailable
at com.sun.media.sound.HeadspaceMixer.nResume(Native Method)
at
com.sun.media.sound.HeadspaceMixer.implOpen(HeadspaceMixer.java:346)
at com.sun.media.sound.AbstractMixer.open(AbstractMixer.java:286)
at com.sun.media.sound.AbstractMixer.open(AbstractMixer.java:323)
at com.sun.media.sound.MixerClip.open(MixerClip.java:162)
at com.sun.media.sound.MixerClip.open(MixerClip.java:256)
at soundtests.Main.main(Main.java:33)
What is a difference? Is Java Sound has been rewritten for Linux?
2009/11/7 Nerius Landys <nlandys at gmail.com>
> Well, the OpenJDK really improves the audio situation for me on Debian
> Linux. I can now finally mix multiple audios together in the Java
> program using Clip, and I can run the Java program while other audio
> apps are running.
>
> However, just wanted to point out that on my system the call
> "AudioSystem.getClip()" does not work. It's not stopping me from my
> programming, but I thought perhaps it should work.
>
> OpenJDK Runtime Environment (build 1.6.0_0-b11)
> OpenJDK 64-Bit Server VM (build 1.6.0_0-b11, mixed mode)
>
> =============================
> import java.io.*;
> import javax.sound.sampled.*;
>
> public class PlayAudios {
>
> public static void main(String[] args)
> throws Exception {
> // This call fails on my 64 bit Debian
> // Lenny 5.0 system, HP Z400 workstation:
> //AudioSystem.getClip();
> // It throws an IllegalArgumentException.
>
> for (String filename : args) {
> AudioInputStream auIn =
> AudioSystem.getAudioInputStream
> (new File(filename));
> AudioFormat format = auIn.getFormat();
> DataLine.Info info = new DataLine.Info
> (Clip.class, format);
> Clip clip = (Clip) AudioSystem.getLine(info);
> clip.open(auIn);
> clip.start();
> }
> Thread.sleep(3000);
> }
>
> }
>
--
-----------------------------------------------------------------
Всего наилучшего
<y6erGn0m.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/sound-dev/attachments/20091108/f945c791/attachment.html
More information about the sound-dev
mailing list