Click to See Complete Forum and Search --> : Operating system volume control


alhajm
November 19th, 2004, 09:40 AM
I had a problem;

I want to write a code that controls the operating system sound volume. The operating system which I am working with is Win XP pro.

I tried to use:
system.setVolume() and system.getVolume(). It does not work.

Thanx

cjard
November 19th, 2004, 10:11 AM
strangely enough it doesnt!; seeing as the System class doesnt even have these methods, i dont think it will ever work either

in java, everything is categorised.. all the gui stuff goes in one package, all the io in another.. given that volume is an audio related thing (bear in mind that some systems that java runs on do not have sound cards.. i.e. washing machines) you wont find it in the base system class (http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html)

i suggest you look through the JavaMedia Framework (JMF) tutorials (http://java.sun.com/products/java-media/jmf/learning/tutorial/)

dlorde
November 19th, 2004, 10:17 AM
I want to write a code that controls the operating system sound volume. The operating system which I am working with is Win XP pro.Java is designed to be platform independent, so it doesn't have OS-specific features like system volume control. The System class deals with the Java runtime environment, not the host operating system. However, the Java Sound API (http://java.sun.com/j2se/1.4.2/docs/guide/sound/programmer_guide/contents.html) and the Java Media Framework (JMF) have loads of sound facilities that allow you to mess with sound in your programs.

I tried to use:
system.setVolume() and system.getVolume(). It does not work.There are no such methods in the System class. It's worth checking the API docs to see what methods are actually available in a class.

The journey of a thousand miles starts with a single step...
Chinese proverb