From cy6ergn0m at gmail.com Sun Nov 1 05:23:34 2009 From: cy6ergn0m at gmail.com (cyberGn0m) Date: Sun, 1 Nov 2009 16:23:34 +0300 Subject: Java and pulseaudio Message-ID: <645d12c20911010523p2ad1f185pff7b04944059d161@mail.gmail.com> Is somebody tried to implement pulseaudio sound line for java? Is it possible to implement this feature as extension for Java Sound? I saw thread about gstreamer.. is the same problem actual for pulse as for gstreamer? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/sound-dev/attachments/20091101/74025d6f/attachment.html From nlandys at gmail.com Sat Nov 7 02:05:37 2009 From: nlandys at gmail.com (Nerius Landys) Date: Sat, 7 Nov 2009 02:05:37 -0800 Subject: Great work on the Java Sound API for Linux! Message-ID: <560f92640911070205ne5fc66ap7b03a747cc012b6c@mail.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); } } From cy6ergn0m at gmail.com Sat Nov 7 14:01:13 2009 From: cy6ergn0m at gmail.com (cyberGn0m) Date: Sun, 8 Nov 2009 01:01:13 +0300 Subject: Great work on the Java Sound API for Linux! In-Reply-To: <560f92640911070205ne5fc66ap7b03a747cc012b6c@mail.gmail.com> References: <560f92640911070205ne5fc66ap7b03a747cc012b6c@mail.gmail.com> Message-ID: <645d12c20911071401x2f63699cx8f01819f00f8e6be@mail.gmail.com> 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 > 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); > } > > } > -- ----------------------------------------------------------------- ????? ?????????? Great work on the Java Sound API for Linux! In-Reply-To: <645d12c20911071401x2f63699cx8f01819f00f8e6be@mail.gmail.com> References: <560f92640911070205ne5fc66ap7b03a747cc012b6c@mail.gmail.com> <645d12c20911071401x2f63699cx8f01819f00f8e6be@mail.gmail.com> Message-ID: <560f92640911071437u49bc1cb2s1524b637b61dc31d@mail.gmail.com> > 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: > What is a difference? Is Java Sound has been rewritten for Linux? Yes, when using the OpenJDK 1.6, I can play sound from my Java app at the same time that other audio apps are running, such as video games, speech-dispatcher, Mumble, etc. Furthermore, in OpenJDK, I can play 2 Clip objects simultaneously and it will mix them for me (presumably using ALSA mix program). On the other hand Sun's JDK does not do all of the above for me. Thank you, OpenJDK. From damjan.jov at gmail.com Sat Nov 7 22:04:00 2009 From: damjan.jov at gmail.com (Damjan Jovanovic) Date: Sun, 8 Nov 2009 08:04:00 +0200 Subject: Great work on the Java Sound API for Linux! In-Reply-To: <560f92640911071437u49bc1cb2s1524b637b61dc31d@mail.gmail.com> References: <560f92640911070205ne5fc66ap7b03a747cc012b6c@mail.gmail.com> <645d12c20911071401x2f63699cx8f01819f00f8e6be@mail.gmail.com> <560f92640911071437u49bc1cb2s1524b637b61dc31d@mail.gmail.com> Message-ID: <9e89675b0911072204r148b28a6m3a82c16ac8ad7723@mail.gmail.com> On Sun, Nov 8, 2009 at 12:37 AM, Nerius Landys wrote: >> 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: >> What is a difference? Is Java Sound has been rewritten for Linux? > > Yes, when using the OpenJDK 1.6, I can play sound from my Java app at > the same time that other audio apps are running, such as video games, > speech-dispatcher, Mumble, etc. ?Furthermore, in OpenJDK, I can play 2 > Clip objects simultaneously and it will mix them for me (presumably > using ALSA mix program). > > On the other hand Sun's JDK does not do all of the above for me. > > Thank you, OpenJDK. > How did you install your OpenJDK? If you're using the Debian package, I think it comes with Pulseaudio support. Please check the jre/lib/ext directory and your /usr/share/java directory for pulse-java.jar. Regards Damjan