Sound From Java Exclusive needs exclusive use of PulseAudio?
I'm making a java program beep using some code borrowed from a web page (can't find that helpful page's URL), but the code snipet is below.
And it beeps very nicely.
I'm running Ubuntu 11.10 ( AMD64) with pulseaudio.
While my java beeps just fine if no other application is using sound, if I have any other app making a sound, the beep is never heard.
Many other application all seem to work at the same time with pulseaudio, but it seems that java requires exclusive use of the sound system if it is to work at all.
Is there any way around this? I want java to beep while I play a some music (for example).
I have tried this using sun/oracle java & openjdk. I have also tried running 'padsp java ...' - all with the same negative result.
Searching the web throws up quite a few examples of people having similar problems, but none with a workable solution (that I've seen so far).
Thanks for any help.
=======
byte[] buf = new byte[msecs*8];
for (int i=0; i<buf.length; i++) {
double angle = i / (8000.0 / hz) * 2.0 * Math.PI;
buf[i] = (byte)(
}
AudioFormat af = new AudioFormat(
SourceDataLine sdl = AudioSystem.
sdl.open(af);
sdl.start();
sdl.write(
sdl.drain();
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- adam jvok
- Solved:
- Last query:
- Last reply: