Uses Azure Speech Cloud, REST HTTP channel (streamed). +\ :description2: For the procedure for registering an MS Azure account and the cost of the service, see https://learn.microsoft.com/en-us/azure/ai-services/speech-service/.

Depending on whether caching is configured on the synthesis service and whether there is data for the synthesized text, the first one and a half seconds can be returned from 300 to 1500 ms.

Speech Synthesis Component (Azure Cloud Speech)

:icons:font :hardbreaks: :imagesdir: ../../../assets/images :toc-title: Contents :toc:

Description

Performs speech synthesis from text and playback to the current subscriber. +\

Setting up a connection in the section domain settings, field 'azure_cloud'.

Allows you to play the result, as well as simply record it into an audio file.

In playback mode, speech begins to play when it appears in the data buffer for 1.5 seconds. +\

Table 1. System characteristics

Index

230

Short name

tts_azure

Script types

IVR

Start module

r_sip_ivr_script_component_tts_sber

Mode

Asynchronous

Icon

230

Branching type

Branching, interrupting

Properties

Table 2. Properties
Specification Description

Name: Azure Speech Account

Code: accountKey

Visibility condition: no

Default: default

Indication of the account that defines connection points to the Microsoft Azure Speech service.

The list contains the 'default' value, which sets the 'speech' root fields to be used in the 'settings.azure_cloud' object.

Additionally, the list includes the keys of the 'settings.azure_cloud.accounts' object, each of which also contains an object with separately configured access parameters.

Name: Mode

Code: mode

Visibility condition: no

Default: Playback

The operating mode of the component after receiving a response from the TTS Azure Speech service.

Possible options:

  • Playback (play, 0) – Playback of synthesized speech to the subscriber and then delete the file.

  • File generation (file, 1) – Save an audio file to a local temporary directory and return the file path to a variable.

Name: Content Type

Code: contentType

Visibility condition: no

Default: SSML

Format of data transmitted in the request body (content_type).

Possible options:

  • SSML (ssml, 1) – SSML markup with text.

Name: Text

Code: text

Visibility condition: no

Default: — 

SSML markup with text.

In addition to the text, the markup indicates the voice model used.

Example:

<speak version='1.0' xml:lang='en-US'>
  <voice xml:lang='en-US' xml:gender='Male' name='en-US-ChristopherNeural'>
     I'm excited to try text to speech!
  </voice>
</speak>

Name: Caching

Code: useCache

Visibility condition: no

Default: no

Caching mode for speech synthesis results.

Caching is designed to speed up the output of the result when frequently accessing the same tasks to the synthesis service, as well as reduce the load on the synthesis service.

If synthesis data changes regularly, it is harmful to cache such operations, since you will have to define and configure a procedure for periodically clearing them.

The first time, if the value is missing, the file is generated using the service and saved in the folder ':GlobalShare/domains/DOMAIN/cache/azure_tts/…​'.

In the future, when a file is detected in the cache, calls to the TTS Azure Speech service do not occur, the file is copied from the cache.

The unique file name hides the display of synthesis parameters: text, language, voice. Files from the cache are not automatically deleted. It is necessary to separately configure the procedure for deleting obsolete data. The criterion may be, for example, the time of the last access to the file.

Possible options:

  • Disable (0) – Caching is not used. Each request is sent for synthesis to the TTS Azure Speech service.

  • Enable (1) – Caching is used.

Name: Abort on DTMF Code: checkDTMF Visibility condition: no

Default: No

DTMF detector switch. Opens the settings for the modes of saving characters and interrupting the operation.

Name: Buffer for DTMF

Code: dtmfBuffer

Visibility condition: yes

Default: — 

Variable for storing received DTMF characters.

Name: Clear DTMF buffer

Code: clearDtmfBuffer

Visibility condition: yes

Default: Yes

DTMF buffer pre-clear switch.

Name: Number of characters

Code: maxSymbolCount

Visibility condition: yes Default: — 

An argument containing a limit on the number of characters entered.

Once the specified number of DTMF symbols are received during execution of a component, the playback operation is completed.

Name: Interrupt characters

Code: interruptSymbols

Visibility condition: yes

Default: — 

A string containing sequences of break characters separated by commas. When a character sequence matching one of the specified interrupt sequences is detected at the end of the DTMF buffer, the playback operation is completed.

For example, *, 7, 123, 9395.

Name: Response waiting timeout, s

Code: responseTimeoutSec

Visibility condition: no

Default: — 

Timeout waiting for a response from the TTS Azure Speech service after sending a request to it. After the timeout expires, control is transferred to the next component along the Time branch.

Name: Response code to variable

Code: varHttpCode

Visibility condition: no

Default: — 

Variable for storing the HTTP response code of the recognition service.

Name: Path to file in variable Code: varFile Visibility condition: yes

Default: — 

Variable for saving the path to the synthesized speech audio file in a local temporary directory.

To save a file for a long time, the script requires further movement of the file to a permanent storage location.

Name: Transition

Code: transfer

Visibility condition: no Default: — 

The component to which control is transferred if the operation completes successfully.

Name: Transition, time

Code: transferTimeout

Visibility condition: no

Default: — 

The component to which control is transferred if the HTTP response from the service times out.

Name: Transition, error Code: transferError Visibility condition: no

Default: — 

Component to which control is transferred in case of an error.