THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Audio volume Property

Audio Object Reference Audio Object

Example

Set audio volume to 20%:

document.getElementById("myAudio").volume = 0.2;
Try it yourself »

Definition and Usage

The volume property sets or returns the audio volume of an audio, from 0.0 (silent) to 1.0 (loudest).

Note: The <audio> element is new in HTML5.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The volume property is supported in all major browsers.

Note: Internet Explorer 8 and earlier versions, do not support the <audio> element.


Syntax

Return the volume property:

audioObject.volume

Set the volume property:

audioObject.volume=number

Property Values

Value Description
number Specifies the audio volume of the audio. Must be a number between 0.0 to 1.0
Example values:
  • 1.0 is highest volume (100%. This is default)
  • 0.5 is half volume (50%)
  • 0.0 is silent (same as mute)

Technical Details

Return Value: A Number, representing the audio volume of the audio
Default Value: 1.0

Audio Object Reference Audio Object