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

opVoiceRate style property | XvVoiceRate style property

Browser support:
opVoiceRate
XvVoiceRate
Specifies or returns the number of spoken words per minute.
Same as the voice-pitch-range property in the CSS3 declaration.
The opVoiceRate and XvVoiceRate properties are equivalent in Opera.

Syntax:

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

Possible values:

The type of this property is string.
 One of the following values: 
fast
Fast. For instance 300 words per minute in English.
inherit
Takes the value of this property from the computed style of the parent element.
medium
Normal speech rate for the language. For instance 180 - 200 words per minute in English.
slow
Slow. For instance 120 words per minute in English.
speaking rate (positive integer)
Positive integer, number of spoken words per minute.
x-fast
Very fast. For instance 500 words per minute in English.
x-slow
Very slow. For instance 80 words per minute in English.
Default: medium.

Example HTML code 1:

This example illustrates the use of the -xv-voice-rate property:
<head>
    <style>
        .example {
            -xv-voice-rate: fast;
        }
    </style>
</head>
<body>
    <p class="example">300 words per minute in English.</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 XvVoiceRate property in JavaScript:
<head>
    <style>
        #example {
            -xv-voice-rate: slow;
        }
    </style>
    <script type="text/javascript">
        function ChangeRate (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 ('XvVoiceRate' in example.style) {
                example.style.XvVoiceRate = selectState;
                // or opVoiceRate
            } 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="ChangeRate (this);" size="5">
        <option>x-slow</option>
        <option selected="selected">slow</option>
        <option>medium</option>
        <option>fast</option>
        <option>x-fast</option>
    </select>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content