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

Created by: Juned Ahsan on 17-08-2009 08:12:48 AM
Hello,
 
I am trying to build Dyanmic Menus in CVP studio using the java code. I need to add multiple "nomatch_audio_group"  and "noinput_audio_group"  audio groups. Here is my code snippet, please provide some pointers how to add multiple audio groups of a type and have different audios set in those audio groups.
 
/////////////////////////////////////////CODE SNIPPET//////////////////////////////////////////////////////////////////
 
    //Get MAX No Input and No Match values
    String strMaxNoInputCount = (String)elementAPI.getSessionData("MaxNoInput");
    String strMaxNoMatchCount = (String)elementAPI.getSessionData("MaxNoInput");
   
    if( strMaxNoInputCount !=null || !"".equals(strMaxNoInputCount.trim())) {
     maxNoInputCount = Integer.parseInt(strMaxNoInputCount);
    }
   
    if( strMaxNoMatchCount !=null || !"".equals(strMaxNoMatchCount.trim())) {
     maxNoMatchCount = Integer.parseInt(strMaxNoMatchCount);
    }
   
    elementAPI.addToLog(elementName,"MaxNoInput Count : " + maxNoInputCount);
    elementAPI.addToLog(elementName,"MaxNoMatch Count : " + maxNoMatchCount);
   
  //NO MATCH
    VoiceElementConfig.AudioGroup nomatchAudioGroup[] = new VoiceElementConfig.AudioGroup[maxNoMatchCount+1];
    defaults.removeAudioGroup("nomatch_audio_group", 1);
    
    for(int j = 1 ; j < maxNoMatchCount ; j++) {
    
     elementAPI.addToLog(elementName,"Creating AudioGroup " + "nomatch_audio_group");
     nomatchAudioGroup = defaults.new AudioGroup("nomatch_audio_group", true , 1);
     //Fetch prompts, options and set in NO INPUT GROUP
     String strnoMatchAudioCount =(String) menusProperties.get(menuId+"_NM_PP_COUNT");
     int noMatchAudioCount = Integer.parseInt(strnoMatchAudioCount);
     VoiceElementConfig.StaticAudio noMatchAudio = null;
     elementAPI.addToLog(elementName,"CONFIGURATION UPDATE : No Match Audio Group");
     for (int i = 1 ; i<=noMatchAudioCount ;i++){
      elementAPI.addToLog(elementName,"No Match Name  : " + menuId+"_NM_PP_"+i);
      elementAPI.addToLog(elementName,"No Match Value : " + menusProperties.getProperty(menuId+"_NM_PP_"+i));
      noMatchAudio = defaults.new StaticAudio("",menusProperties.getProperty(menuId+"_NM_PP_"+i));
      nomatchAudioGroup.addAudioItem(noMatchAudio);
     }
     elementAPI.addToLog(elementName,"No of audios set in audio group : " + nomatchAudioGroup.getName()
       + " is  : " + nomatchAudioGroup.getNumAudioItems());
     defaults.setAudioGroup(nomatchAudioGroup);
    }
    //For the last audio group to play silence only
    nomatchAudioGroup = defaults.new AudioGroup("nomatch_audio_group", true,1);
    elementAPI.addToLog(elementName,"Adding NoMatchGroup ");
    VoiceElementConfig.StaticAudio finalNoMatchAudio = defaults.new StaticAudio("","ID_OPT_9.wav");
    nomatchAudioGroup.addAudioItem(finalNoMatchAudio);

    elementAPI.addToLog(elementName,"Audio Group Name : "  + nomatchAudioGroup.getName());
    elementAPI.addToLog(elementName,"No of audios set in AudioGroup : " + nomatchAudioGroup.getName()
      + " is  : " + nomatchAudioGroup.getAudioGroupCount());
 
    defaults.setAudioGroup(nomatchAudioGroup);
   
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