views:

219

answers:

3

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.

+1  A: 

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.

Luca Matteis
no not commenting, I need some other way to skip over the section
Priyank Bolia
A markup way? So the synth ignores it?
Luca Matteis
+1  A: 

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.

lc
there is always a maximum rate that you can set for speaking text, also not all voices will handle the volume stuff themselves.
Priyank Bolia
Yeah, but I don't think you have another option. If you can insert a pre-parser between your XML and the synthesizer, you could define a <dont-say> tag, and strip these using string functions, like you say. At least the text will still be in the source XML, since that appears to be your requirement.
lc
+1  A: 

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>
Jiri
Thanks, I finally done it through the string manipulations functions only as it is much easier and efficient to remove the unused text. But your answer is correct and accepted solution. Thanks for the answer, not able to mark as accepted as the bounty is expired.
Priyank Bolia