Speak command

The Speak command converts the given text to speech and plays it to the other party of the current API extension call. In case of third party call control, it can also play it to the caller, callee or all.

<Speak> command example usage:

It is used when a spoken text has hundreds or thousands of outcomes and it would be too expensive to make pre-recorded sounds for every outcome. You can just put in variables in the text and they will be spoken. It is widely used in IVRs using variables for example it reads back the account number of the client. It is also used to speak during a conversation for example if one of the parties are low in telephone credits it could say: 'You have 1 dollar left in your phone account. Please recharge it as soon as possible!'

Parameters:

Note: CallId is only considered in case of third party call controlling. Party is only considered for third party call control, but in this case it is mandatory.

Parameter name Value Description Mandatory
CallId string value,
e.g. H2Wwb
The call ID of the call you want to run the Speak command on. By default it is known from the CallChanged notification. No
Text string value,
e.g. hello world
The text you want to convert to speach. The parameter can be provided between the command nodes. Yes
Party string value
(caller, callee or all)
The destination party to send the speach to. No
Language string value,
short code format of the languages
e.g.: "en-UK"
Select the language of the read text from the installed text-to-speech packages. No

Examples of extension control

Simple example:

The speak engine asks: 'How are you?'

<?xml version="1.0"?>
<Response>
  <Speak Language="en-UK">How are you?</Speak>
</Response>

Detailed example:

1 second passes then the speak engine says: "Congratulations, this is your first OzML Response command." After this 2 second passes and the speak engine says: "Have a nice day!".
Then says to two text with different Text to speech engine (english, portuguese). Of course these engines have to be installed on your server. Learn more!

In the end it hangs up the phone.
<?xml version="1.0"?>
<Response>
  <Delay>1</Delay>
  <Speak>Congratulations, this is your first OzML Response command.</Speak>
  <Delay>2</Delay>
  <Speak>Have a nice day!</Speak>
  <Speak Language="en-UK">
      Hello, this text will be read out in English language.
  </Speak>
  <SpeakLanguage="pt-BR">
      Olá, este texto será lido em Português.
  </Speak>
  <Hangup></Hangup>
</Response>

Speak command is used in OzML responses to these Api Extension Control notifications:
GoTo, RecordCompleted, DtmfEntered, SMSDeliveryReport, IncomingSMS, IncomingCall, CallConnected

Examples of third party call control

Simple example:

The speak engine says to all participants: 'We are recording the conversation.'

<?xml version="1.0"?>
<Response>
    <Speak Party="all">We are recording the conversation.</Speak>
</Response>

Detailed example:

First it plays hello.wav from ContentStorage/Static directory in Ozeki Phone System install directory to all participants of the phone call.

Then says to two text with different Text to speech engine (english, portuguese). Of course these engines have to be installed on your server. Learn more!

Then says to all participants: "The callee will be transfered to number 1001." Then it transfers the callee to 1001.

<?xml version="1.0"?>
<Response>
  <Play Party="all">hello.wav</Play>
  <Speak Language="en-UK" Party="all">
      Hello, this text will be read out in English language.
  </Speak>
  <Speak Language="pt-BR" Party="all">
      Olá, este texto será lido em Português.
  </Speak>
  <Speak Party="all">The callee will be transfered to number 1001.</Speak>
  <BlindTransfer TransferorParty="callee" Target="1001"></BlindTransfer>
</Response>
Speak command is used in OzML responses to these notifications:
CallChanged, RecordCompleted

More things to know:

  • "12345" is pronounced: "twelve thousand three hundred and forty five"
    "1 2 3 4 5" is pronounced: "one two three four five"
  • This command is best used if the conversation can have hundreds of outcomes, otherwise the Play command is advised using pre-recorded sound.
  • If you put in a comma or period you will hear a pause, which is like a short Delay command.
  • If you want to use a longer pause in the speach, then a Delay command is advised. <Delay> should be placed outside of the <Speak></Speak> nodes, as seen in the detailed example above.

The following table shows the languages are supported by Ozeki Phone System. All these languages can be used for text to speech.

Language Code Language Code Language Code
1. Catalan (Spain) ca-ES 10. Danish (Denmark) da-DK 19. German (Germany) de-DE
2. English (Australia) en-AU 11. English (Canada) en-CA 20. English (United Kingdom) en-GB
3. English (India) en-IN 12. English (United States) en-US 21. Spanish (Spain) es-ES
4. Spanish (Mexico) es-MX 13. Finnish (Finland) fi-FI 22. French (Canada) fr-CA
5. French (France) fr-FR 14. Italian (Italy) it-IT 23. Japanese (Japan) ja-JP
6. Korean (Korea) ko-KR 15. Norwegian (Norway) nb-NO 24. Dutch (Netherlands) nl-NL
7. Polish (Poland) pl-PL 16. Portuguese (Brazil) pt-BR 25. Portuguese (Portugal) pt-PT
8. Russian (Russia) ru-RU 17. Swedish (Sweden) sv-SE 26. Chinese (S) zh-CN
9. Chinese (Hong Kong) zh-HK 18. Chinese (T) zh-TW
Table 1 - Supported Languages

More information