cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
117
Views
0
Helpful
0
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: Mark Applebee on 23-08-2013 06:58:21 AM
 am trying to creat my first dynamic audio element and getting the following error messge:

The error was: The dynamic configuration cannot return a null element configuration.
The code is below. Please let me know what I am missing.
public VoiceElementConfig getConfig(String name,  ElementAPI elementAPI,VoiceElementConfig defaults) throws AudiumException  
  {
   // PUT YOUR CODE HERE.  
  try
    {   
 AudioGroup initAudioGroup = defaults.new AudioGroup("initial_audio_group", true );
defaults.setAudioGroup(initAudioGroup);
StaticAudio  mailAudio1 = defaults.new StaticAudio("Test", "200002.wav");
mailAudio1.setUseDefaultAudioPath(true);
initAudioGroup.addAudioItem(mailAudio1); 
  }catch(Exception e){
    elementAPI.addToLog("Exception Occurred",e.getMessage()); 
                                    }        
return defaults; 
  }


Subject: RE: Dynamic Voice Element
Replied by: Janine Graves on 23-08-2013 09:55:06 AM
Your dynamic configuration should check whether the parameter it's receiving (named 'defaults') is null. If it is null, then you need to reinstantiate it before adding data to it.

try
    {  
          if (defaults ==null) {
                 defaults = new VoiceElementConfig();
          }
           AudioGroup initAudioGroup = defaults.new AudioGroup("initial_audio_group", true );
          defaults.setAudioGroup(initAudioGroup);
          etc, etc, etc.
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