"voice" Element

Description

Sets the voice to be used.

Syntax

<voice
  xml:lang = "locale"
  gender = "male" | "female" | "neutral"
  age = "integer"
  variant = "integer"
  name = "name">
  child elements
</voice>

Attributes

AttributeDescription
xml:langLanguage of the voice. Optional field.
genderGender of the voice. Optional field.
ageAge of the voice. Optional field.
variantOther vocal characteristics. Optional field.
nameName of the voice. Optional field.

Parent

<audio>, <emphasis>, <p>, <prosody>, <s>, <speak>, <voice>

Children

<audio>, <break>, <emphasis>, <mark>, <p>, <phoneme>, <prosody>, <say-as>, <sub>, <s>, <voice>, #TEXT, #CDATA-SECTION

Limitations/Restrictions

The platform supports only the xml:lang, name, and gender attributes. The age and variant attributes are not supported and are ignored.

The priority of application is: name > xml:lang > gender.

Within a single SSML document/synthesis request, it is not possible to switch between voices of the TTS1 type and voices of the TTS2 family.

Although each attribute individually is optional, it is an error if no attributes are specified when the voice element is used.

Example

<?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 name="Rebecca"> I am a woman </voice>
  <voice name="Jason"> My name is Jason </voice>
</speak>

Was this article helpful?