Producing web pages
* HTML CSS DHTML XHTML A to Z of tags        Accessibility          Design

volume

The volume property allows you to specify the volume. It doesn't set the overall volume, the users still control that just like they control the volume when they listen to a CD. This property lets you manage the relative volume of different bits of text in your page.

You can enter any value between zero (0) and 100. Zero is the softest and 100 is the loudest volume. For example:

body {volume: 25;}

Remember that the softest volume isn't necessarily silent. For example, an aural browser in a noisy car might have a minimum volume designed to be heard above the noise of the road and surrounding traffic. Setting the volume to zero for this browser still produces sound, even if it is very quiet.

You can also specify an absolute volume (x-soft, soft, medium, loud, or x-loud):

body {volume: medium;}

Each of the key words correspond to a number: x-soft is equivalent to zero, soft to 25, medium to 50, loud to 75 and x-loud to 100.

Another way is to use a percentage value. This sets the volume as a percentage of the current default volume. So, to make a phrase softer, you might assign it a volume of 50%. As the volume of the containing flow goes up and down, the affected phrase will always be half of that volume.

For example:

p {volume: 50%;}

If you set the property to silent, there is no sound at all. You should note though that the time it would take to speak the tag's content the still exists, you just can't hear it.

The browser should allow the listener to set the values that corresponding to zero and 100. No one setting is right for all situations.

Suitable values depend on:

  • The equipment the listener uses (speakers, headphones)
  • The environment (in car, home, theatre, library). For example, you might there might be lots of background noise if you use a browser in a car. The listener might set the volumes for zero and 100 high so that the speech is audible over the road noise. If you use a speech browser in a shared study room, the listener might set zero and 100 to a very quiet level
  • Personal preferences