Author Message
LeonardoSalas
Joined: Sep 29, 2014
Messages: 23
Offline
My speech application has a Voice Portal -programmable variable in order to indicate the path where the application's audios are stored. It is assumed that this facility giving by Orquestation Designer with this type of variables is to customize the path with my audios, however even do one copy of all the files and copy them to a different path and changing the path in this parameter the application still pointing to the original path . why?

My original path is: http://localhost:7080/HerediaAudios/spanish/

I created a new folder http://localhost:7080/HerediaAudios800/spanish/ and copied all .wav here.

I know my war file was generated perhaps the original audio-path as value in this variable, but it is assumed that this variable is configurable once posted on the voice portal. My case is of the image where the Lauch column shows "800pendientes" :

  • [Thumb - Screen Shot 2014-12-04 at 4.34.54 PM.png]
[Disk] Download
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
Given that you have a CAV (configurable application variable) and the you set it in the Voice Portal admin, where are you using the variable in your application?
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
Look at this sample application. In DynamicPhraseset.java you will see the code below:


if(field.getIntValue() <= 2) {
try {
String phraseNumber = field.getStringValue().trim();

// Get the request url so we can use that to create a url to our audio file.
URL url = new URL(getMySession().getRequest().getRequestURL().toString());

// Get the base path to the phrase from the web.xml file.
ServletContext context = getMySession().getServlet().getServletContext();
String basePath = context.getInitParameter("myphrases.basepath");

// create a url to the phrase file.
String urlString = new URL(url.getProtocol(), url.getHost(), url.getPort(),
"/" + basePath + "/" + phraseNumber + ".wav").toString();

// create the phrase with the URL string.
phrase = new ExternalPhrase(urlString);
} catch (MalformedURLException e) {
throw new SCERuntimeException("Error generating URL to phrase file.", e);
}

} else {

// create the dynamic URL generator which will be invoked to calculate the URL to the audio file..
DynamicURLGenerator urlGen = new PhraseURLGenerator();

// create the phrase with the URL generator
phrase = new ExternalPhrase(urlGen);
}




What you would do here is replace this code with code that gets your CAV and constructs a URL


IVariableField field = getMySession().getVariableField("mycav");

String basePath = field.getStringValue();
phrase.getFileName()

// create a url to the phrase file.
String urlString = basePath + "/" +phrase.getFileName();

// create the phrase with the URL string.
phrase = new ExternalPhrase(urlString);


Filename DynamicPhraseLoading.zip [Disk] Download
Go to:   
Mobile view