Priyank Bolia
Priyank Bolia

Reputation: 14431

How to skip some section of text while speaking using SSML

Is there some SSML tags etc, to remove a particular line of text from speaking. Yes, I know I can remove this using string functions, before sending it to the speech synthesizer. But my question is, is there any way to mark or tag some text, so that it won't play. I am looking for some XML based solution for this issue.

Upvotes: 5

Views: 2237

Answers (4)

SRB
SRB

Reputation: 1

Using meta tag might offer some solution.

<speak>This is spoken <meta  content="this is not spoken"/> </speak>

Upvotes: 0

Jiri
Jiri

Reputation: 16625

There are so many ways, you should clarify what you want to accomplish.

Maybe one of these will help you:

   1. standard XML comment <!-- -->
   2. <sub alias=" "> your text </sub>
   3. <audio src='short_silence.wav'> your text </audio>
   4. <prosody volume='silent'> your text </prosody>

Upvotes: 4

lc.
lc.

Reputation: 116498

Looking quickly at the SSML Documentation from W3C, I found the prosody element.

It looks like you might be able to skip the section by setting the volume to 0 and setting the duration to a very small value.

Setting the volume to zero should suppress the audio output, but it will likely take the same time to "read" the section as if it were being read out loud. If you set the duration as well, you should be able to essentially "skip" over the section (quickly read it silently).

You'll have to experiment to see if this works.

Upvotes: 1

Luca Matteis
Luca Matteis

Reputation: 29267

I'm wondering if XML commenting is a valid solution for what you're trying to accomplish:

<!-- <say-as interpret-as="telephone" format="39">+39.347.7577577</say-as> -->

Or:

<say-as interpret-as="telephone" format="39"><!-- +39.347.7577577 --></say-as>

Hope this helps.

Upvotes: 1

Related Questions