VoiceXML 2.1 Development Guide Home  |  Frameset Home


<say-as>  element


Sometimes a developer needs to control how the TTS engine interprets text, especially numbers.  The say-as element allows you to potentially define whether the text should be interpreted as time, boolean, date, digits, currency, number, phone, or time.  Note that the actual available values may vary, depending on the TTS engine in use.


usage

<say-as format="CDATA" interpret-as="CDATA">


attributes

format Data Type: CDATA Default: Optional
The format attribute is used by some TTS engines to further define how certain types of text get interpreted, such as date and time.  Currently, the Prophecy, Rhetorical and Speechify TTS engines do not make use of the format attribute, but a third party TTS engine might.  Consult the TTS guide relevant to your deployment for more information.
interpret-as Data Type: CDATA Default: Required
The interpret-as attribute defines how the TTS engine will interpret the specified text.  As an example, if the text value is 1234 and interpret-as is set to number, then the TTS engine will render the value as "one-thousand, two-hundred, thirty-four".  If interpret-as is set to digits, the TTS engine will render the value as "one, two, three, four".  Consult the TTS guide relevant to your deployment for a complete list of available interpret-as values; documentation for the Voxeo supported TTS engines can be found below:

Prophecy TTS

Rhetorical TTS

Speechify TTS



shadow variables

none


parents

<audio>   <choice>   <emphasis>   <enumerate>   <option>   <paragraph>   <prompt>   <prosody>   <sentence>


children

<value>


code samples

Universal 'say-as' code sample for Prophecy, Rhetorical and Speechify TTS Engines.
<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml" xmlns:voxeo="http://community.voxeo.com/xmlns/vxml">
<form id="F1">

<!-- Refer to the individual TTS Engine guides for more information -->
<!-- Prophecy TTS: http://www.vxml.org/frame.jsp?page=p8_tts.htm -->
<!-- Rhetorical TTS: http://www.vxml.org/frame.jsp?page=p8rhetorical_tts.htm -->
<!-- Speechify TTS: http://www.vxml.org/frame.jsp?page=sp_tts.htm -->

<block>
 
   <prompt xml:lang="en-us">
           
     <!-- DATE -->
     <say-as interpret-as="vxml:date">20011215</say-as>
     <!-- DIGIT -->
     <say-as interpret-as="vxml:digits">238.2</say-as>
     <!-- CURRENCY -->
     <say-as interpret-as="vxml:currency">USD20.54</say-as>
     <!-- NUMBER -->
     <say-as interpret-as="vxml:number">123</say-as>
     <!-- PHONE -- NOTE: The use a plus "+" is not permitted. -->
     <say-as interpret-as="vxml:phone">8001112222x987</say-as>
      <!-- TIME -->
     <say-as interpret-as="vxml:time">1157h</say-as><break/>
      <!-- BOOLEAN -->
     <say-as interpret-as="vxml:boolean">true</say-as>

    </prompt>
 
</block>
</form>



additional links

W3C SSML 1.0 Specification


  ANNOTATIONS: EXISTING POSTS
MattHenry
6/22/2004 5:20 PM (EDT)
---
alexey.timofeev
12/6/2006 7:35 AM (EST)
code example:
<say-as interpret-as="address">
    De la Baya TX CA
</say-as>
it is interpreted as:
"Delaware Luisiana Baya Texas California"
how can I force Voxeo to speak 'De', not 'Delaware' ?
jbassett
12/6/2006 8:29 AM (EST)
Hi Andrew,

I whipped up a quick app and used the code below, and I did not encounter the same result. "De La Baya" is read correctly, and if I add a comma before TX, it is read correctly as well.

If you would like to, feel free to open a support ticket about this on our support forums. You could attach the xml file you are using if you would like, and let us know whether you are using prophecy, or our  free osted platform.

<prompt>test
<say-as interpret-as="address">De la Baya TX CA</say-as>
</prompt>
alexey.timofeev
12/6/2006 9:08 AM (EST)
jbassett, I found the reason. First script:
<?xml version="1.0"?>
<vxml version="2.1">
<property name="nuance.core.tts.ResourceName" value="en-US.F019"/> 
    <form id="start">
        <block>addres is:<prompt><say-as interpret-as="address">De la Baya TX CA</say-as></prompt></block>
    </form>
</vxml>
Second script:
<?xml version="1.0"?>
<vxml version="2.1"> 
    <form id="start">
        <block>addres is:<prompt><say-as interpret-as="address">De la Baya TX CA</say-as></prompt></block>
    </form>
</vxml>
First script pronounces: "Delaware Luisiana Baya Texas California", second script pronounces address correctly. The difference is <property name="nuance.core.tts.ResourceName" value="en-US.F019"/>. Could you please explain such behaviuor?
MattHenry
12/6/2006 1:17 PM (EST)


Hi there,

Bear in mind that the different TTS engines are going to interpret the SSML in a different fashion: No two TTS engines are identical in terms of how they will interpret abbreviations for SSML tags; each engine will simply do it's best to interpret the string in the format requested. This isn't a bug by any means, simply an example of how different TTS engines behave.

~Matt
aniruddha
4/10/2007 2:49 AM (EDT)
Hi,

I want to accept the input from the user and want to play that as currency. The specs say that the format to accept the input is UUUmm.nn where UUU is the currency code. So do I give the input as 84050.75 (840 is the currency code for USD) if I want to play it as 50 Dollars 75 cents?

Thanks in advance.

Aniruddha
jbassett
4/10/2007 3:35 AM (EDT)
Hello,

Yes, that would be acceptable for input. As far as the <say-as> tag, you would only need to do something like the example.

<prompt>testing interp as type currency <break strength="medium"/>
            <say-as interpret-as="currency">$12.76</say-as>
    </prompt>

If you are looking for ways to use grammars to capture input, I would suggest looking at the nuane extension grammars for currency. http://docs.voxeo.com/voicexml/2.0/xnuancegrams.htm

e.g.

<rule id="MYRULE">
      <one-of>
        <item>
          <ruleref uri="builtin:x-nuance-currency-10k"/>
          <tag><![CDATA[ <MyField $return> ]]> </tag>
        </item> 
      </one-of>
    </rule>
</grammar>

Let me know if this helps.

Thanks,
Jesse Bassett
Voxeo Support
chicks
8/8/2007 4:13 PM (EDT)
I'm trying to say highway numbers correctly, without luck so far.

E.g., I want hiway 101 to be spoken as one-oh-one, not one-hundred-one, and 415 as four-fifteen, not four-hundred-fifteen, and 980 as nine-eighty, not nine-hundred-eighty.

Any hints?
mikethompson
8/8/2007 5:58 PM (EDT)
Hi there,

While what you're after is not part of a say-as solution, you can utilize conditional logic within your <filled> to determine the highway spoken, and output as necessary.

For example:

<filled>
  <if cond="Field1=='408'">
  <prompt>
    <audio src="408.wav">four oh eight</audio>
  </prompt>
  </if>
</filled>

Hope this helps,
Mike Thompson
Voxeo Corporation
bose123
4/22/2008 1:52 PM (EDT)
Hi Friends,

IS this possible to play the address as "WEST" if the input is given as "W" in VXML 2.0?

I have a input as "200 W Monroe Street".  If i gave like this, the observed behaviour is as 200 W Monroe street, but my expected one is as 200 West Monroe street.

Please help me ASAP.

Thanks,
Bose.
VoxeoDustin
4/22/2008 6:10 PM (EDT)
Hey Bose,

This is in fact possible using the interpret-as="address" attribute of <say-as>, however this is a proprietary Nuance tag, and as such, will only work when using Nuance TTS. I have added access to this on your Evolution account and you can test it out by creating a new application using the multi-language platform listed in Application Manager.

Thanks,
Dustin
jefo12
7/2/2008 9:31 AM (EDT)
What is the difference in voxeo and tell me servers..
i compiled in voxeo and executed but i can't able to sxecute in tellme studio... can u plz suggest me why it happens?.
voxeo_chris
7/2/2008 10:12 AM (EDT)
Hi Jefo,

Unfortunately we do not have a great deal of insight into what exactly Tellme Studios supports but I would take a gander that they currently do not support the <say-as> element.  However, Voxeo being the only 100% VXML 2.0 compliant company, does support this element.  Hope this answers your question.

Regards,
Chris
valpadasi
2/25/2010 6:11 PM (EST)
Hi,

<say-as interpret-as="number">3560</say-as>
When I execute the above line it says thirty sixty instead of three thousand five hundred and sixty.
This only happens to certian numbers of 4 digits.

Any help to avoid this, and make it read as three thousand five hundred sixty.

Thanks
Vinay
voxeoblehn
2/25/2010 6:17 PM (EST)
Hello,

Please try the following format:
[code]
<say-as interpret-as="vxml:number">3560</say-as>
[/code]
This should read correctly for you.

Standing By,

Brian Lehnen
Voxeo Support

valpadasi
2/26/2010 11:47 AM (EST)
Brian Lehnen ,

I used  <say-as interpret-as="vxml:number">3560</say-as>
it still reads thirty five sixty.
The TTS that I am using is provided by Nuance.
Will that make a difference?

Thanks
Vinay
jdyer
2/26/2010 12:03 PM (EST)
Hello Vinay,

Which TTS package are you using? RealSpeak? Also, which voice are you using?  Implementation of SSML functionality is really left up to the TTS vendor, so I would like to ensure any examples we provide will work with your specific TTS package. We are standing by for your update at this time.

Regards,

John Dyer
Customer Engineer
Voxeo Support
v_naga_raju
3/24/2010 7:53 AM (EDT)
Hi,

When we are trying to spell the number, it spells the digits. But there is gap between the digits. Can you please let me know how to create a gap between the digits to spell? Here is the program:
=============================================

<?xml version="1.0" encoding="UTF-8"?>
<vxml version = "2.1" >

<form>
    <block>
<prompt>
    You are calling from the number
    <break time="1000"/>
    <say-as interpret-as="number" format="digits">
          <value expr="session.callerid"/>
    </say-as>
</prompt>
    </block>
    <block>
<disconnect/>
    </block>
</form>
</vxml>

==============================================
Thanks
Naga
voxeoJeffK
3/24/2010 8:18 AM (EDT)
Hello,

I'm not exactly clear on the results you are getting versus what your goal is. Can you clarify with an example? For instance, is it you want the number "1234" to be pronounced as "one two three four"? How is it pronouncing it now?

Regards,
Jeff Kustermann
Voxeo Support
smilett
4/24/2010 7:49 AM (EDT)
Hello,

I am trying to prompt email address using <say-as> element

There is a piece of code

================================

<prompt>
the email address is

<say-as interpret-as="net" format="email">
  abcd@test.com
</say-as>

</prompt>
====================================

When I test this on phrophecy9, it said "playback error".
And when I clear those <say-as> statements, it works fine, but of course can not prompt as a email address.

Could you please give me some help?

Bob
voxeoJeffK
4/24/2010 8:17 AM (EDT)
Hello Bob,

Different say-as formats are dependent upon the TTS engine used. The "email/net" format is from older Rhetorical voices. In the case of Prophecy's built-in TTS that format is not supported. We do have details on the supported say-as formats for you here though:

  http://www.vxml.org/frame.jsp?page=p8_tts.htm

Regards,
Jeff Kustermann
Voxeo Support
smilett
4/24/2010 8:25 AM (EDT)
Hello Jeff,

Thank you for your quick answer.

I have referenced to this web page, but I did not find any support for email address prompts.

for example, the email address is bob@test.com
in my prophecy, by default it will say "bob at test dot com"
but not "b o b at t e s t dot c o m"

it there any way could make this happen?

Thank you!

Bob
VoxeoDustin
4/24/2010 9:49 AM (EDT)
Bob,

There is no way unfortunately to do this automatically, the TTS engines will try to pronounce it rather than spell it out. Probably your best bet is to use a little scripting to insert a space between each character, which will force the behavior you're looking for.

Give this code snippet a try:

<?xml version="1.0"?>
<vxml version="2.1">

<var name="my_email" expr="'bob@email.com'"/>

<script>
function format_email(email) {
  var patt1=/./g;
  var result = email.match(patt1).join(",");
  result = result.replace(/\./, " dot ");
  return result;
  }
</script>

<form>
<block>
  <prompt> <break time="2s"/> Your email address is <value expr="format_email(my_email)"/> </prompt>
</block>
</form>
</vxml>

Let me know if this is the functionality you're looking for.

Regards,
Dustin
smilett
4/24/2010 10:40 PM (EDT)
Hello Dustin,

Thank you very much for your help!
It works!

Regards,
Bob

login



© 2013 Voxeo Corporation  |  Voxeo IVR  |  VoiceXML & CCXML IVR Developer Site