You are here: Reference > JavaScript > client-side > style handling > properties > browser specific extensions > opVoiceVolume

opVoiceVolume style property | XvVoiceVolume style property

Browser support:
opVoiceVolume
XvVoiceVolume
Sets or retrieves the volume of a spoken element.
Same as the voice-volume property in the CSS3 declaration.
The opVoiceVolume and XvVoiceVolume properties are equivalent in Opera.

Syntax:

object.opVoiceVolume;
object.XvVoiceVolume;
You can find the related objects in the Supported by objects section below.
XvVoiceVolume: This property is read/write.
opVoiceVolume: This property is read/write.
CSS page for this property: -op-voice-volume

Possible values:

The type of this property is string.
 One of the following values: 
inherit
Takes the value of this property from the computed style of the parent element.
loud
Same as '75'.
louder
Relatively louder volume.
medium
Same as '50'.
silent
No sound at all.
soft
Same as '25'.
softer
Relatively softer volume.
volume (integer [0-100])
Integer between 0 and 100.
volume in percentage
The volume is the specified percentage of the inherited voice-volume value.
x-loud
Same as '100'.
x-soft
Same as '0'.
Default: medium.

Example HTML code 1:

This example illustrates the use of the -xv-voice-volume property:
<head>
    <style>
        .example {
            -xv-voice-volume: loud;
        }
    </style>
</head>
<body>
    Normal volume.
    <p class="example">Sets the volume to loud.</p>
    Select the text in the document, right click and select speak
</body>
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of the XvVoiceVolume property in JavaScript:
<head>
    <style>
        #example {
            -xv-voice-volume: loud;
        }
    </style>
    <script type="text/javascript">
        function ChangeStress (selectTag) {
            var example = document.getElementById ("example");

            // Returns the index of the selected option
            var whichSelected = selectTag.selectedIndex;

            // Returns the text of the selected option
            var selectState = selectTag.options[whichSelected].text;

            if ('XvVoiceVolume' in example.style) {
                example.style.XvVoiceVolume = selectState;
                // or opVoiceVolume
            } else {
                alert ("Your browser doesn't support this example!");
            }
        }
    </script>
</head>
<body>
    Normal voice
    <p id="example">Select the text in the document, right click and select speak</p>
    Normal voice
    <select onchange="ChangeStress (this);" size="8">
        <option>silent</option>
        <option>x-soft</option>
        <option>soft</option>
        <option>medium</option>
        <option selected="selected">loud</option>
        <option>x-loud</option>
        <option>louder</option>
        <option>softer</option>
    </select>
    Select
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content