voice-range property CSS Reference

Definition and Usage

The 'voice-range' property specifies the variability in the "baseline" pitch, i.e. how much the fundamental frequency may deviate from the average pitch of the speech output. The dynamic pitch range of the generated speech generally increases for a highly animated voice, for example when variations in inflection are used to convey meaning and emphasis in speech. Typically, a low range produces a flat, monotonic voice, whereas a high range produces an animated voice.

Name: voice-range
Value: <frequency> && absolute | [[x-low | low | medium | high | x-high] || [<frequency> | <semitones> | <percentage>]]
Initial: medium
Applies to: all elements
Inherited: yes
Percentages: refer to inherited value
Media: speech
Computed value: one of the predefined pitch keywords if only the keyword is specified by itself, otherwise an absolute frequency calculated by converting the keyword value (if any) to a fixed frequency based on the current voice-family and by applying the specified relative offset (if any)


voice-range: <frequency> && absolute | [[x-low | low | medium | high | x-high] || [<frequency> | <semitones> | <percentage>]];



A value in frequency units (Hertz or kiloHertz, e.g. "100Hz", "+2kHz"). Values are restricted to positive numbers when the 'absolute' keyword is specified. Otherwise (when the 'absolute' keyword is not specified), a negative value represents a decrement, and a positive value represents an increment, relative to the inherited value. For example, "2kHz" is a positive offset (strictly equivalent to "+2kHz"), and "+2kHz absolute" is an absolute frequency (strictly equivalent to "2kHz absolute").


If specified, this keyword indicates that the specified frequency represents an absolute value. If a negative frequency is specified, the computed frequency will be zero.


Specifies a relative change (decrement or increment) to the inherited value. The syntax of allowed values is a <number> followed immediately by "st" (semitones). A semitone interval corresponds to the step between each note on an equal temperament chromatic scale. A semitone can therefore be quantified as the difference between two consecutive pitch frequencies on such scale. The ratio between two consecutive frequencies separated by exactly one semitone is the twelfth root of two (approximately 11011/10393, which equals exactly 1.0594631). As a result, the value in Hertz corresponding to a semitone offset is relative to the initial frequency the offset is applied to (in other words, a semitone doesn't correspond to a fixed numerical value in Hertz).


Positive and negative percentage values are allowed, to represent an increment or decrement (respectively) relative to the inherited value. Computed values are calculated by adding (or subtracting) the specified fraction of the inherited value, to (from) the inherited value. For example, 50% (which is equivalent to +50%) with a inherited value of 200Hz results in 200 + (200*0.5) = 300Hz. Conversely, -50% results in 200-(200*0.5) = 100Hz.

x-low, low, medium, high, x-high

A sequence of monotonically non-decreasing pitch levels that are implementation and voice specific. When the computed value for a given element is only a keyword (i.e. no relative offset is specified), then the corresponding absolute frequency will be re-evaluated on a voice change. Conversely, the application of a relative offset requires the calculation of the resulting frequency based on the current voice at the point at which the relative offset is specified, so the computed frequency will inherit absolutely regardless of any voice change further down the style cascade. Authors should therefore only use keyword values in cases where they wish that voice changes trigger the re-evaluation of the conversion from a keyword to a concrete, voice-dependent frequency.

Computed absolute frequencies that are negative are clamped to zero Hertz. Speech-capable user agents are likely to support a specific range of values rather than the full range of possible calculated numerical values for frequencies. The actual values in user agents may therefore be clamped to implementation-dependent minimum and maximum boundaries. For example: although the 0Hz frequency can be legitimately calculated, it may be clamped to a more meaningful value in the context of the speech synthesizer.


body { voice-range: inherit; } /* the initial value is 'medium'
                               (the actual frequency value
                               depends on the current voice) */
e1 { voice-range: +25%; } /* the computed value is
                          ['medium' + 25%] which resolves
                          to the frequency corresponding to 'medium'
                          plus 0.25 times the frequency
                          corresponding to 'medium' */
e2 { voice-range: +10Hz; } /* the computed value is
                          [FREQ + 10Hz] where "FREQ" is the absolute frequency
                          calculated in the "e1" rule above.
e3 { voice-range: inherit; /* this could be omitted,
                           but we explicitly specify it for clarity purposes */
     voice-family: "another-voice"; } /* this voice change would have resulted in
                              the re-evaluation of the initial 'medium' keyword
                              inherited by the "body" element
                              (i.e. conversion from a voice-dependent keyword value
                              to a concrete, absolute frequency),
                              but because relative offsets were applied down the style
                              cascade, the inherited value is actually the frequency
                              calculated at the "e2" rule above. */
e4 { voice-range: 200Hz absolute; } /* override with an absolute frequency
                                    which doesn't depend on the current voice */
e5 { voice-range: 2st; } /* the computed value is an absolute frequency,
                         which is the result of the
                         calculation: 200Hz + two semitones
                         (reminder: the actual frequency corresponding to a semitone
                         depends on the base value to which it applies) */
e6 { voice-range: inherit; /* this could be omitted,
                           but we explicitly specify it for clarity purposes */
     voice-family: "yet-another-voice"; } /* despite the voice change,
                              the computed value is the same as
                              for "e5" (i.e. an absolute frequency value,
                              independent from the current voice) */

Relative articles