6         Handling External Resources

This chapter explains how to easily import external resources like grammar or audio files into your application.

Why Handling External Resources?

In most applications you will need external resources such as grammar files, audio or video files, or connectors. These external resources are also represented by objects within your application. To make them available you need to create the corresponding object.

Depending on the number of e.g. audio files you have to register in your application, this may require a substantial effort. VoiceObjects provides two features explained below, using resource locators and the audio file registration functionality in Desktop for Web, which you can use to handle these external resources in a quick and straightforward way.
To handle the prompts in your application, and thus audio files, use the Storyboard Manager described in the Storyboard Manager Guide.

@8  Tip: It is strongly recommended to create a project version before proceeding with the audio file registration dialog. You should also pay close attention to the audio filename convention.

Using Resource Locators

External resources must be stored on a server location that is accessible during the processing of the dialog with VoiceObjects Server. Because the location may change over time or may differ between development and production environments the concept of resource locators has been introduced.

A resource locator is a type of object that represents a location of external resources. Within this Resource Locator object the physical path to search for available files and the URL (Uniform Resource Locator) for referencing files at call time can be specified. Variable, Expression, or Script objects can be used to dynamically modify the URL at call time. For more information on the Resource Locator object see the Object Reference.

If an object refers to an external file, this file may be specified by a Resource Locator object and the filename.

Example: If you have a single folder containing all your audio files, you can specify a single Resource Locator object pointing to the physical path and the URL of this folder. All Audio objects referring to audio files can now use this single Resource Locator object. If, later on, the location of the files changes, you only need to make a single adjustment.

Audio File Registration Process

Sophisticated Voice User Interfaces (VUI) make use of a large number of audio files that are represented by Audio objects. To minimize the effort of creating these Audio objects, audio file registration functionality is provided, which registers all required audio files in one step and automatically creates the corresponding Audio objects. This feature is only supported in Desktop for Web.

@8  Tip: For full support of the prompt design and audio file creation process, it is recommended to use the Storyboard Manager. This tool can generate fully-defined Audio objects on the basis of the written prompts, and these objects can directly be imported into an application.

Audio filename convention

Audio filenames should follow a consistent naming scheme, otherwise it is impossible to group variations or match the alternative texts properly.

All audio files should adhere to the following basic scheme:

Name_Variation.xxx

Where xxx is the format used (e.g. wav).

More details on this scheme (and some deviations) are described in the following list.

·          Never put a number at the end of a filename, unless it's to indicate a prompt variation

·          If you have variations for a prompt, append the variation number at the end of the filename, preceded by a "_":
AskForPIN_1.wav, AskForPIN_2.wav, etc.

·          If you do not have variations, use AskForPIN.wav

Audio file registration

To use audio file registration do the following:

1.        Make sure you have defined a Resource Locator object pointing to the physical location of the audio files to be registered. The physical location in the Resource Locator object must be a constant string.

2.        From the Tools menu in VoiceObjects Desktop, select Audio File Registration. The Audio File Registration window opens up.



3.        In the Resource Locator field, select the appropriate Resource Locator object for the audio files.

4.        If the audio files are located in a lower level directory than the specified resource locator, specify the relative position in the Relative Path field (e.g. if your resource locator points to c:\VoiceObjects and your audio files are located in c:\VoiceObjects\Audio insert \Audio into the Relative Path field).

5.        In the File Extension field, enter the file extension of the audio files (default is .wav).

6.        Optionally, specify a prefix and suffix for the names of the Audio objects to be created.

7.        If the Group variations check box is selected, variations of audio files will be grouped together into one Audio object. Variations are indicated by same file names differing only by subsequent number suffixes and may for example contain the same audio text in different languages. By default, the Group variations check box is selected. Note that the state of this check box is important in terms of how the alternative text files are interpreted. If Group variations is selected you have to define only one text file that matches the filename of the first variation. If Group variations is clear you can define one text file for each audio file to provide its alternative texts.

For more information on how to use alternative texts refer to the section Alternative texts for audio.

8.        If the Ignore missing variations check box is selected, the audio file registration will group audio file variations into one Audio object ignoring any missing numbers. If this check box is selected and you have three audio files welcome_1.wav, welcome_2.wav and welcome_5.wav, an Audio object with five variations will be created. If the check box is clear two Audio objects, one with two variations and one with only one variation will be created. By default, the Ignore missing variations check box is selected.

9.        Click Next to see the list of available audio files.



10.    Check the boxes left to the file names of the files you want to register. To select or clear all check boxes at once, use the Select All or Deselect All button at the bottom of the list.

11.    In the Object Name field, specify the Audio object names for the files to be registered. By default, the name of the audio file is used. Note that prefix and suffix will be added to this name (if specified).

12.    In the Short Description field, enter a short description for the Audio object.

13.    Click Register to create all Audio objects and to register all files. The created Audio objects will show up in the Object Browser.

Alternative texts for audio

This section describes how to define the format and filename of alternative text files for Audio objects, so that they are imported simultaneously during the audio file registration process.


Format convention of the text files

The alternative texts for the Audio objects have to be defined in a text file that is stored in the following format type:

Name*Description
#Index~Language~Input mode~Alternative text

Name
Name of the Audio object; will be stored in the Name field. This parameter is optional, if not defined the audio filename (without existing variations in the case Group variations is selected) will be used as object name.

Description
Short description of the Audio object; will be stored in the Short Description field in the Properties section. This parameter is optional, and if not defined, the short description field of the Audio object will be empty.

Index
Variation number of the alternative text; will be stored in the Index field in the Alternative Text section. Possible values are numbers from 1 to 99. If no variations for random prompting are being used, set the index to 1. This parameter is mandatory.

Language
Language of the alternative text; will be stored in the Language field in the Alternative Text section. Possible values are all supported language abbreviations (e.g. en-EN) and default. This parameter is mandatory.

Input mode
Input mode of the alternative text; will be stored in the Input mode field in the Alternative Text section. Possible values are voice, dtmf, voicedtmf, and default. This parameter is mandatory.

Alternative text
Alternative text will be stored in the text field in the Alternative Text section. This parameter is mandatory.

 

Filename convention of the text files

The filename of an alternative text file depends on your intention of how to handle variation of audio files. During the audio file registration dialog you have to define this setting with the check box Group variations.

If you want to group existing variations of the same prompt (e.g. askForAge_1.wav and askForAge_2.wav) into one logical Audio object, you have to provide only one alternative text file that matches the filename of the first variation. (e.g. askForAge_1.txt).

Example:


 

If you want to register all audio files (e.g. askForAge_1.wav and askForAge_2.wav) as independent Audio objects you need to create a separate alternative text file for each audio file (e.g. filename askForAge_1.txt and askForAge_2.txt).

Examples: