0

I wonder if we strictly need to specify xml header in our requests to ssml synthesizers like the following:

<?xml version=\"1.0\"?><speak>hello world</speak>

or does the SSML standard also allow this?:

<speak>hello world</speak>
fatihk
  • 7,789
  • 1
  • 26
  • 48

3 Answers3

2

IN SSML specification there is a section https://www.w3.org/TR/speech-synthesis/#S2.1 that says:

A legal stand-alone Speech Synthesis Markup Language document must have a legal XML Prolog [XML ยง2.8].

For XML 1.0 both <?xml version=\"1.0\"?><speak>hello world</speak> and <speak>hello world</speak> are well-formed, so it's not strickly needed to specify a xml header.

2

I use the Azure and Google TTS engine in dot.net Core and for Azure in the line

synthesizer.SpeakSsmlAsync(SSML)

I can send SSML text without the XML header

I think the answer is now

Azure TTS : No Google TTS: No

<speak version='1.0' xmlns='http://www.w3.org/2001/10/synthesis' xml:lang='en-US' xmlns:mstts = 'http://www.w3.org/2001/mstts'> 
        <voice name = 'en-US-BrandonNeural'>
         Hello Stack Overflow
        </voice>
        </speak>
1

Azure TTS: Yes, xml header required

Google TTS: No

mhcpan
  • 331
  • 3
  • 7