cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
634
Views
0
Helpful
0
Comments
cdnadmin
Community Member
This document was generated from CDN thread

Created by: Fabien Damien on 10-08-2009 11:21:04 AM
Dears,
 
how can we develop a dynamic voice elements that creates audio items based on a value retreived from a database, or entered by the user.
 
thanks for your prompt help,

Subject: Re: New Message from Fabien Damien in Customer Voice Portal (CVP) - CVP - A
Replied by: Janine Graves on 10-08-2009 02:06:16 PM
Fabien,

Your best bet is to create a 'dynamic configuration' that fills in just
the audio portion for whatever element you want to speak it in. This
will be MUCH simpler than creating your own voice element from scratch.
A Dynamic Configuration configures the Audio and/or Settings for an
element at runtime. It has access to all the element/session data, can
go to a DB, and can configure the audio based upon that. Once it's done
running, the Vxml Server uses the config'n created by that Java and
executes the element (which could be an Audio element, or a Form
element, or whatever).

Look in the Vxml Server Programming Guide for an overview of how to
create a Dynamic Element Configuration. That will point you to the
appropriate Java Docs classes.

Janine

Cisco Developer Community Forums wrote:
> Fabien Damien has created a new message in the forum "CVP - All Versions":
>
> --------------------------------------------------------------
> Dears,
> Â
> how can we develop a dynamic voice elements that creates audio items
> based on a value retreived from a database, or entered by the user.
> Â
> thanks for your prompt help,
> --
> To respond to this post, please click the following link:
>
> <http://developer.cisco.com/web/cvp/forums/-/message_boards/message/1537641>
>
> or simply reply to this email.

Subject: RE: Re: New Message from Fabien Damien in Customer Voice Portal (CVP) - CVP
Replied by: Fabien Damien on 13-08-2009 06:01:51 AM
Hi Janine,
 
Thanks for your reply, i've used the following dynamic voice class:
 
public VoiceElementConfig getConfig(String name,
ElementAPI elementAPI,
VoiceElementConfig defaults) throws AudiumException
{
//set up the Audio prompts for the initial audio
VoiceElementConfig.AudioGroup initialAudioGroup;
 
//If no audio exists yet, then create an initial audio group. Else add to existing.
if(defaults.getAudioGroup("initial_audio_group",1) == null){
initialAudioGroup = defaults.new AudioGroup("initial_audio_group", true);//true=allow bargein
} else {
initialAudioGroup = defaults.getAudioGroup("initial_audio_group",1);
}
VoiceElementConfig.StaticAudio prompt1 =
defaults.new StaticAudio(null,"/numbers/Numbers/1.wav");
VoiceElementConfig.StaticAudio prompt2 =
defaults.new StaticAudio(null, "/numbers/Numbers/2.wav");
VoiceElementConfig.StaticAudio prompt3 =
defaults.new StaticAudio(null,"/numbers/Numbers/3.wav");
 
initialAudioGroup.addAudioItem(prompt1);
initialAudioGroup.addAudioItem(prompt2);
initialAudioGroup.addAudioItem(prompt3);
 
// Add the initial Audio Group to the Voice Element Configuration.
defaults.setAudioGroup(initialAudioGroup);
 
 
 
// Alter defaults or create a new configuration and return.
return defaults;
}
}
 
in addition to static audio i need to use sayitsmart audio items how can this be done?
 
 
Thannks for your feedback,

Subject: Re: New Message from Fabien Damien in Customer Voice Portal (CVP) - CVP - A
Replied by: Janine Graves on 14-08-2009 05:32:17 PM
Fabien,

The constructor for Say it Smart is a lot like static audio. It's a
nested class of the VoiceElementConfig. Look in the JavaDocs for
VoiceElementConfig and then look at VoiceElementConfig.SayItSmart for
the constructor and the methods to call to set the Record Audio Path, etc.

VoiceElementConfig.SayItSmart(String aClass, String inputFormat, String
outputFormat, Object data)
          This constructor creates a new Say It Smart audio item whose
value is passed as an argument.

Janine*
*
Cisco Developer Community Forums wrote:
> Fabien Damien has created a new message in the forum "CVP - All Versions":
>
> --------------------------------------------------------------
> Hi Janine,
> Â
> Thanks for your reply, i've used the following dynamic voice class:
> Â
> *public VoiceElementConfig getConfig(String name,*
> *ElementAPI elementAPI,*
> *VoiceElementConfig defaults) throws AudiumException*
> *{*
> *//set up the Audio prompts for the initial audio*
> *VoiceElementConfig.AudioGroup initialAudioGroup;*
> *Â *
> *//If no audio exists yet, then create an initial audio group. Else
> add to existing.*
> *if(defaults.getAudioGroup("initial_audio_group",1) == null){*
> *initialAudioGroup = defaults.new AudioGroup("initial_audio_group",
> true);//true=allow bargein*
> *} else {*
> *initialAudioGroup = defaults.getAudioGroup("initial_audio_group",1);*
> *}*
> *VoiceElementConfig.StaticAudio prompt1 =*
> *defaults.new StaticAudio(null,"/numbers/Numbers/1.wav");*
> *VoiceElementConfig.StaticAudio prompt2 =*
> *defaults.new StaticAudio(null, "/numbers/Numbers/2.wav");*
> *VoiceElementConfig.StaticAudio prompt3 =*
> *defaults.new StaticAudio(null,"/numbers/Numbers/3.wav");*
> *Â *
> *initialAudioGroup.addAudioItem(prompt1);*
> *initialAudioGroup.addAudioItem(prompt2);*
> *initialAudioGroup.addAudioItem(prompt3);*
> *Â *
> *// Add the initial Audio Group to the Voice Element Configuration.*
> *defaults.setAudioGroup(initialAudioGroup);*
> *Â *
> *Â *
> *Â *
> *// Alter defaults or create a new configuration and return.*
> *return defaults;*
> *}*
> *}*
> Â
> in addition to static audio i need to use sayitsmart audio items how
> can this be done?
> Â
> Â
> Thannks for your feedback,
> --
> To respond to this post, please click the following link:
>
> <http://developer.cisco.com/web/cvp/forums/-/message_boards/message/1544220>
>
> or simply reply to this email.
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links