3

I have a IVR application that is running SSML 2.0 on Voice Server 4.0

I am able to successfully slow down TTS output when using

<prosody rate="slow"> Hello </prosody> 

I am also able to use say-as to speak digits, instead of a whole number

<say-as interpret-as="number_digit">1234567890</say-as>

However, I seem unable to be able to be able to use both at once. As long as <say-as> is active, the rate does not change.

for example

<prosody rate="slow">
<say-as interpret-as="number_digit">1234567890</say-as>
</prosody> 

Produces an output of single digits, but not at a slow pace. Is there some sort of compatibility issue or something I am missing? Or, is there another way to go about accomplishing my goal. The number being spoken is a long number the user has to verify, so a slowdown in TTS is very important.

Robert Dickey
  • 816
  • 14
  • 35

1 Answers1

2

This may work :

<say-as interpret-as="number_digit">
  <prosody rate="slow">1234567890</prosody> 
</say-as>

This will work :

<prosody rate="slow">1</prosody>
<prosody rate="slow">2</prosody>
<prosody rate="slow">3</prosody>
...

Here is how to do that using PHP :

<?php   
for($i = 0; $i < strlen($number.""); $i++){ //$number."" to cast it as string.
?>
  <prosody rate='slow'><?=substr($number, $i, 1)?></prosody>
<?php
}
?>
Loïc
  • 11,804
  • 1
  • 31
  • 49
  • The bottom example works as we would expect, it does read off each digit at a slow rate. However, the top example does not. It seems that when Prosody is inside of the tag it crashes voice server. When it is outside of the say-as it is just disregarded and TTS reads it fast. The problem with example 2, is that it is a user inputted value and cannot be hard coded. Maybe there is a work around to break up the digits? Is it possible to split up a string into single digits via php? Worse come to worse maybe i could bite the bullet and it read off each split up digit – Robert Dickey Oct 14 '15 at 20:31
  • Thank you! The last code snippet was able to resolve my issue. I did make a modification though. for future reference I removed Prosody from the PHP snippet and added that allows more of a pause without the distortion that prosody caused. Thanks alot for your help. – Robert Dickey Oct 16 '15 at 14:00