3

I am trying to build a program in Java, which would be able to output sound to different output lines on my sound card.

SCHEME

How is it possible to do in Java?

bluish
  • 26,356
  • 27
  • 122
  • 180
rkrv.
  • 372
  • 2
  • 10

3 Answers3

0

You can use Jack (Jack Audio Connection Kit) to route sound to your soundcard. It is a little complicated, it doesn't work with pulseaudio, but you can make it work.

JnaJack provides an interface from Java to the Jack API via JNA. It's really quite easy.

I wrote it up in more detail here.

Christine
  • 5,617
  • 4
  • 38
  • 61
0

I'm not sure what background you have in working with sound (it might be bigger than mine) but what I think you have is a number of lines that you want to direct to a number of ports? http://download.oracle.com/javase/7/docs/api/javax/sound/sampled/package-summary.html - This might be an API for this, which I don't know much about (I've seen a program using something like that with VoIP). By the way if yr working on Windows, I believe that some information about your soundcard is stored in the registry, and you might have to update the registry from the program to gain access to it (not sure).

I hope I helped somehow :)

Eugene Marin
  • 1,706
  • 3
  • 23
  • 35
  • Thanks. From what I've managed to collect I think there is no way in Java to see what channels my sound card has. I am able to play sounds through it, but only on the channels set to default on my system preferences. I am on a mac by the way. – rkrv. Feb 14 '11 at 09:32
0

Check out the Java sound programmer's guide.

To get this to work I had to reconfigure my sound card to expose its ports as separate "outs"; otherwise the sound card would route the sound automatically depending on whether a pair of headphones were plugged in. (On Windows.)

volley
  • 6,651
  • 1
  • 27
  • 28
  • How did you reconfigure your soundcard? I did this on Mac, but I also need it to work on Windows and haven't found a way to do so yet. – rkrv. Mar 15 '11 at 12:11