Audio volumeProperty
Examples
Set the audio volume to 20%:
document.getElementById("myAudio").volume = 0.2;
Try it Yourself »
Definition and Usage
The volume property sets or returns the volume of the audio, from 0.0 (silent) to 1.0 (loudest).
Note:The <audio> element is new in HTML5.
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the volume property.
Note:Internet Explorer 8 or earlier browsers do not support this property.
Syntax
Return the volume property:
audioObject.volume
Set the volume property:
audioObject.volume=number
Property Values
| Value | Description |
|---|---|
| volumevalue |
Specifies the current volume of the audio. Must be a number between 0.0 and 1.0. Example values:
|
Technical Details
| Return Value: | A number, representing the volume of the audio. |
|---|---|
| Default Value: | 1.0 |
Audio Object Other Extensions