I have a
Java (1.6) application which plays Wave files using the JavaSound API.
The problem I'm having is that after each reboot of the machine, the master volume control on the machine is set to zero (I think it's the motherboard monitor software doing this, but haven't been able to get anywhere with the manufacturer).
What I would like to do is to have my Java application just adjust the volume to 100% each time it begins to play the Wave file (note: The application sends the sound to a home theater system, where the user controls the volume. The application (machine's) volume should always be 100%).
I've been going through the JavaSound documentation, and can't find a way to do this.
I've written a simple
test program to play with this. This program calls AudioSystem.getMixerInfo() to get a list of Mixer.Info objects.
My machine has 8 Mixer.Info objects.
I then call mixer.getSourceLineInfo() to get a list of Line.Info objects.
I then call mixer.getLine(lineInfo) to get a line.
I then call line.getControl(FloatControl.Type.MASTER_GAIN) on the line to get the volume control.
No matter what I set the master volume to on the machine, the volume control's getValue() returns 0.0
No matter what I pass to the volume control's setValue(), the master volume doesn't change.
Is it possible to adjust the volume control on the PC from within a Java application?
Can anyone point me to a tutorial/sample which shows how to do it?
Thanks,
Here is the code from my sample application, if it helps: