Search code examples
javalinuxaudiojavasoundalsa

Java/Linux: sound output on wrong card


I have a java application that replays some PCM sound on my linux box. Unfortunately it uses the wrong soundcard.

I could direct xine by using the .asoundrc to the correct soundcard - but how can I tell the JVM which sound output to use by default?


Solution

  • Do you know how to list the "Mixers" that are available/visible? This JavaTutorial covers this topic.

    http://docs.oracle.com/javase/tutorial/sound/accessing.html

    If it is listed, you can have the Java application be written to select it. I don't know how to set a JVM sound card default though. That is probably more of an OS issue, is my guess. I'm thinking there is some spot in Linux that is being consulted by the JVM.

    I hope this is at least somewhat helpful. Good luck!