I'm creating an audio player program in HTML and Javascript. How can I adjust the volume in my program?
+1
A:
Changing the volumne requires access to the operating system's audio device driver or some abstraction layer.
The only way to change the volume is on Windows using ActiveX.
DR
2009-07-04 07:34:46
A:
I'll assume that you're relying on the browser's default plugin to play the audio files. If you're using WMP through object elements, then you could dynamically change the settings using javascript.
// get the element's DOM reference, replace to fit needs
obj = document.getElementById("player");
// set volume, 0=mute, 100=full
obj.Settings.volume = 50;
Combine that with a slider widget (i.e. jQuery UI), and that should work.
reference: http://www.mioplanet.com/rsc/embed_mediaplayer.htm
thezachperson31
2009-07-04 21:31:58