aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes Java Sound API and JSliders Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Java Sound API and JSliders" Watch "Java Sound API and JSliders" New topic
Author

Java Sound API and JSliders

Eric Hensel
Greenhorn

Joined: May 22, 2012
Posts: 1
So I've been reading through the Java Sound API, which isn't necessarily a walk in the park, trying to find out how to get control of my PC's main Speakers.
I'm currently writing a program that I want to be able to control my PC's main audio output through a JSlider. For example, if I was playing a song on iTunes
I would like to be able to adjust the volume from my GUI.

I've looked through these two articles in the Java Sound documents: http://docs.oracle.com/javase/tutorial/sound/accessing.html
http://docs.oracle.com/javase/tutorial/sound/controls.html
And I've also been using this thread to help me find the specific port for my speaker on my PC: http://www.coderanch.com/t/492931/java/java/Adjusting-master-volume-Windows-XP

I've been using a test program with just one JSlider to try to get control of my speakers. Under the slider's ChangeListener method I have the following code:


Whenever I move the slider it prints out the error Exception message "Failed trying to find...". Why isn't it letting me obtain the volCtrl on my main output speakers?
How can I fix this code to get control of my SPEAKER?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Sound API and JSliders