Jump to content
  • AzureTTS - 3.1 - Usage

    AzureTTS - 3.1 - Usage

    VBScript   Lua

     

    An example call routing script can be found in A.1 - Example: Announce Text.

     

    a1.png

     

     

    Configure action parameters

     

    a2.png

     

    By double clicking a parameter in the list, you can edit it.

     

    Region

    This is the configured region of your speech subscription. A list of available values can be found at the Text to speech REST API page under "Prebuilt neural voices".

     

    SubscriptionKey

    This is the subscription key of your speech subscription. Please read under 1 - Preparations how to obtain it.

     

    Text

    This is the text you want to get announced. Make sure that the language of the text matches the following "Language" parameter.

     

    Language

    This is the language of the above given "Text". You need to enter a BCP 47 language tag, like "de-DE", "en-GB", "fr-FR". This value can also be taken from the beginning of the "Voice" parameter.

     

    Voice

    This is the voice your text should be announced in. A list of all available voices can be found in the Azure Speech Voice Gallary. There you a huge selection of different voices per language and gender.

    Once you have chosen a voice, you need to switch to "Samplecode" in the right box and grab the "SpeechSynthesisVoiceName" from there, e.g. "en-GB-SoniaNeural" or "de-DE-ConradNeural".

     

    Gender

    This is the gender of the above chosen voice. Valid values are "Male" or "Female".

     

    OwnSSML

    The AzureTTS extension uses the above parameters (Text, Language, Voice, Gender) to generate some basic so called "Speech Synthesis Markup Language (SSML)" which is passed the the Azure Speech system. 

    SSML specifies in detail how the speech is getting generated. If you want to use your own SSML code instead of the very basic one the AzureTTS extension generates you can use this parameter.

    Your own SSML code must comply to the Azure Speech SSML document structure and events

    Once you use your own SSML code the above parameters (Text, Language, Voice, Gender) will be completely ignored and no SSML code will be generated anymore.

     

     

    Configure action exits

     

    a3.png

     

    Exit 0 (Default)

    This exit will be reached when everyhting worked fine and the given text has been announced. It is recommmended to name this exit "Played".

     

    Exit 1

    This exit will be reached when there was any kind of problem and no text has been announced. It is recommended to name this ecit "Failed".

    If you reach this exit you can refer to 3.2 - Trouble Shooting to figure what went wrong.

     

     

     

    Additional return value (as global variable)

     

    g_sAzureTTS_LatestWavFile

    This global variable holds the name of the generated and played .wav file (path + filename).

     

    From a Swyx Server perspective this is a temporary file which will be automatically deleted once the call ends (i.e. the call routing script finishes).

     

    If you want to keep the .wav file for your own use, you need to copy it to another location before the call ends (just like you would have to do with announcements you recorded using the "Record Announcement" GSE block).

     

    To do so, just use an Insert Script Code block right behind the Played exit to copy the generated temporary wav file to a permanent location. 
    This only works with the VBScript version of the extension.
     

    Dim fso
    Set fso = CreateObject("Scripting.FileSystemObject")
    fso.CopyFile g_sAzureTTS_LatestWavFile, "C:\MyFiles\"
    Set fso = Nothing
    UseExit = 0

     

     


    Tom Wellige
     Share


     Share




×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.