View Full Version : Need help with increasing volume on mp3 javascript!

06-19-2004, 10:11 AM
I really, really need help increasing the volume of the mp3's that play on my webpage. I know they can be increased because when I right click on the embedded windows media player, i have the choice to increase volume.

Could someone give me a snippet of javascript that increases the volume to either the maximum, or something like 200% above normal.


here's the random mp3 code Iím using. any help is greatly appreciated! :)

<!--developed by A1 javascripts-http://www.A1javascripts.com -Please keep these lines intact if using this random midi script-->

var nummidi = 5
day = new Date()
seed = day.getTime()
ran = parseInt(((seed - (parseInt(seed/1000,10) * 1000))/10)/100*nummidi + 1,10)

if (ran == (1))
if (ran == (2))
if (ran == (3))
if (ran == (4))
if (ran == (5))
document.write('<EMBED SRC= "' + mp3 + '" controller=TRUE align=left height=24 width=35 Autostart=true hidden=false loop=true>')

06-19-2004, 11:36 AM
Windows Media Player SDK Settings.volume (http://msdn.microsoft.com/library/en-us/wmplay/mmp_sdk/settingsvolume.asp)

06-20-2004, 01:06 AM
Windows Media Player SDK Settings.volume (http://msdn.microsoft.com/library/en-us/wmplay/mmp_sdk/settingsvolume.asp)

Thank you very, very much, but how do i add this to my javascript?

06-20-2004, 03:31 AM
For Internet Explorer, there are a couple of options. Each would probably require that your javascript be modified, or rewritten.

Option 1: add the media player object to the page (Player Control Guide (http://msdn.microsoft.com/library/en-us/wmplay/mmp_sdk/playercontrolguide.asp)), and script Object Model (http://msdn.microsoft.com/library/en-us/wmplay/mmp_sdk/windowsmediaplayeractivexcontrol.asp) methods for that.

Option 2: add the sound files as t:AUDIO (http://msdn.microsoft.com/workshop/author/behaviors/reference/time2/elements/audio.asp) elements of HTML+TIME: Media (http://msdn.microsoft.com/workshop/author/behaviors/reference/timemedia_entry.asp), and script methods for those.
Both options are well documented.

I suggest that you read through enough of the information to decide which approach would be best, and then try out some of the provided examples.

If you have further questions, please provide the html that you are working with, in addition to the javascript.

06-20-2004, 04:04 AM
Ok, sorry, i'm a javascript noob, and really have no idea even when to begin.

I got this code:

<t:AUDIO VOLUME="100" ID=oSegment1 PLAYER=dmusic SRC="sample.sgt"/>

from that page, but have no idea if it will work, or even where to put it to test if it will work.

Could you please be a little more specific, such as "place this code here, and try" or something like that? Sorry, I just have no idea


06-20-2004, 04:28 AM
Could you please be a little more specific...
Would you like me to read the tutorials for you?

This is going to require some effort on your part. I might be willing to help with the scripting, but am not going to rebuild your page...

06-20-2004, 05:03 AM
fine fine, sorry

just thought there might be some piece of code you add somewhere.

something simple

forget it.