HTML volume code

HOW DO I LOWER THE MUSIC VOLUME?!?!?!
my html:


<html>
<body>

<audio autoplay='1' src='https://dl.dropboxusercontent.com/u/179449381/html source/atomized/Calming_Dubstep_Mix.ogg'>
Well snap... So it didn't really accept audio. Mystery.</audio>


it plays audio fine but its too loud and i need a volume html code and i need to know where to put it

This ought do the trick:



<script type="text/javascript">
function setVolume() {
	audio = document.getElementById("audio");
	audio.volume = 0.2; // 1.0 is 100%, 0.2 is 20% of the volume. Etc.
}
</script>

<audio id="audio" type="audio/ogg" autoplay="true" onplay="setVolume()" style="visibility:hidden" src="https://dl.dropboxusercontent.com/u/179449381/html%20source/atomized/Calming_Dubstep_Mix.ogg">


0.2 (20%) of the volume was quite nice to be honest.

[editline]23rd January 2014[/editline]

By the way, may I ask what’s the name of the first song in the mix?

EDIT:
Youtube embeds seem to be broken…

Thank you very much! Greatly appreciated! You get 5/5 toasts from me, sir!

[editline]23rd January 2014[/editline]

In fact, this was the one I was looking for! http://www.youtube.com/watch?v=-GsxT_Cg2TA
I like dem wubz!

Tried the exact same code but with a different source and it didn’t work. Anyone know why?

Source I used: https://dl.dropboxusercontent.com/u/178154165/AruarianDance.ogg

Thanks.

Send me the link for your loading screen please. I’d like to investigate the source code. You might’ve misplaced the Javascript.

http://thelounge.zxq.net/Lounge/lounge.php

I also just noticed that their source link has “/html%20source/atomized/”. Does that matter?*

EDIT: It works now?.. Somehow… Wasn’t working 3 of the times I visited the page and then refreshed again and it worked… odd…

Anyways, Thank you!!

Try that.



<html>
        <head>
            <script type="text/javascript">
                function setVolume() {
                   audio = document.getElementById("audio");
                   audio.volume = 0.5; // 1.0 is 100%, 0.2 is 20% of the volume. Etc.
                }
            </script>
                <title>Loading Screen</title>
                <style type="text/css">
                        body {
                                padding:0px;
                                margin:0px;
                                background-color:#000000;
                        }
                </style>
        </head>
        <body>
                <img src="http://i.imgur.com/dpzCGpR.jpg" style="max-width:100%; max-height:100%; position:absolute; margin:auto; top:0; left:0; bottom:0; right:0;" alt="">
                <audio id="audio" type="audio/ogg" autoplay="true" onplay="setVolume()" style="visibility:hidden" src="https://dl.dropboxusercontent.com/u/178154165/AruarianDance.ogg">
        </body>
</html>