I am currently learning how to build a simple MP3 player with jlgui (using swt to control it). While i am getting along nicely there is one thing which is really throwing me and that is controlling the volume and pan of the sound coming out of the computer.
I have a class which creates a BasicPlayer object and a BasicController to go with it. I have tried to use the BasicController.setGain method but all it does if I put any value in it is set the volume to be muted, and I cant seem to change this value during the playback of the song. Id be really grateful if anyone could give me some help on this as its driving me nuts :-(
Also considered trying the following suggestion
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(new File("C:\\Kasabian.mp3"));
Clip clip = AudioSystem.getClip();
clip.open(audioInputStream);
FloatControl gainControl = (FloatControl) clip.getControl(FloatControl.Type.MASTER_GAIN);
But not really sure how to combine it with jlgui.