Last reviewed: 3/23/2024 11:33:24 AM

In this article

<voice>

The voice element requests a change in speaking voice.

<?xml version="1.0"?>
<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.w3.org/2001/10/synthesis
                   http://www.w3.org/TR/speech-synthesis/synthesis.xsd"
         xml:lang="en-US">   
  <voice gender="female">Mary had a little lamb,</voice>
  <!-- now request a different female child's voice -->
  <voice gender="female" variant="2">
  Its fleece was white as snow.
  </voice>
  <!-- processor-specific voice selection -->
  <voice name="Mike">I want to be like Mike.</voice>
</speak>

Attributes

age

Optional. Value indicating the preferred age in years (since birth) of the voice to speak the contained text.

gender

The preferred gender of the voice to speak the contained text. Valid values include "female", "male", or "neutral".

name

Optional. Specifies a processor-specific voice name to speak the contained text. The value may be a space-separated list of names ordered from top preference down.

variant

Optional. Specifies a preferred variant of a voice's characteristics to speak the contained text.

xml:lang

Optional. Indicates the natural language of the enclosing element and its attributes and subelements.

Children

<audio>, <break>, <desc>, <emphasis>, <mark>, <p>, <phoneme>, <prosody>, <say-as>, <sub>, <s>, <voice>.

Parents

<speak>

Source: Speech Synthesis Markup Language (SSML) Version 1.0