Cisco Cisco Customer Voice Portal Downloads Guia Do Programador
C
HAPTER
10:
S
AY
I
T
S
MART
P
LUGINS
C
ISCO
CVP V
OICE
XML 3.1
Programmer
Guide
output formats, so when the output format changes, the list of filesets available changes
accordingly. The plugin defines these dependencies using a configuration method. Note that a
fileset deals with audio files so does not apply when the Say It Smart value is rendered in TTS
only.
accordingly. The plugin defines these dependencies using a configuration method. Note that a
fileset deals with audio files so does not apply when the Say It Smart value is rendered in TTS
only.
As usually occurs with components configured in CVP VoiceXML Studio, each type, input
format, output format, and fileset has a real name, display name, and description. The display
name is shown in Studio in dropdown menus. The real name is used everywhere else. This
design allows the Say It Smart plugin developer to use a display name that visually represents the
appropriate information but choose a real name that is small, easy to remember, and will not
change. As long as the real name stays the same, the developer can change the display name of
any component without affecting backwards compatibility. At this point, the descriptions are not
displayed in Studio and are there for future compatibility.
format, output format, and fileset has a real name, display name, and description. The display
name is shown in Studio in dropdown menus. The real name is used everywhere else. This
design allows the Say It Smart plugin developer to use a display name that visually represents the
appropriate information but choose a real name that is small, easy to remember, and will not
change. As long as the real name stays the same, the developer can change the display name of
any component without affecting backwards compatibility. At this point, the descriptions are not
displayed in Studio and are there for future compatibility.
All Java classes related to Say It Smart plugins are found in the
com.audium.server.sayitsmart
package.
Note that unlike elements, Say It Smart plugin classes are instantiated as needed. This means that
the developer is free to use static, member, and local variables as they would expect. It is still
recommended to avoid using static variables in Say It Smart plugin classes unless they are static
final because static variables will be reset whenever the application is updated.
the developer is free to use static, member, and local variables as they would expect. It is still
recommended to avoid using static variables in Say It Smart plugin classes unless they are static
final because static variables will be reset whenever the application is updated.
Execution Methods
SayItSmartContent convertToFiles(Object data, String inputFormat,
String outputFormat, String fileset)
This is the execution method for converting data to a list of audio files with TTS backups. The
first argument is the data to convert. This data can be any Java object and it is up to the plugin to
cast to the appropriate type (usually depending on what the input format is). Most of the time,
though, it will be considered a
first argument is the data to convert. This data can be any Java object and it is up to the plugin to
cast to the appropriate type (usually depending on what the input format is). Most of the time,
though, it will be considered a
String
. The next three arguments list the real names of the input
format, output format, and fileset specified in the voice element configuration (either statically in
CVP VoiceXML Studio or dynamically).
CVP VoiceXML Studio or dynamically).
The method returns an instance of
SayItSmartContent
. This class encapsulates any number of
audio filenames, their TTS backups, and pauses to insert in the playback. The execution method
must create an instance of this class, add the desired content to it, and return it. CVP VoiceXML
Server then reads this content to generate the VoiceXML for the Say It Smart audio item in the
audio group. Note that the path and file type options available in the Say It Smart configuration
in Studio are not passed here as they are added automatically by the Server once the plugin has
converted the data. The plugin should produce just the audio file names without any paths or
extensions.
must create an instance of this class, add the desired content to it, and return it. CVP VoiceXML
Server then reads this content to generate the VoiceXML for the Say It Smart audio item in the
audio group. Note that the path and file type options available in the Say It Smart configuration
in Studio are not passed here as they are added automatically by the Server once the plugin has
converted the data. The plugin should produce just the audio file names without any paths or
extensions.
Note that while the option exists, the plugin need not include TTS backups for the audio files.
They are used as a backup in case the audio file is not found or is corrupted. Not including a
They are used as a backup in case the audio file is not found or is corrupted. Not including a
Copyright 2001 - 2005 Audium Corporation. All Rights Reserved. 10/05
66