cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5312
Views
0
Helpful
10
Replies

UCCX single play prompt step for multiple wav files

Hi there!

Is possible to use single 'Play Prompt' step to play a chain of .wav files on UCCX?

For example, have variable chain_audio that can contain different content length

ex:

chain_audio = "P[1.wav] P[2.wav] P[3.wav]"

chain_audio = "P[1.wav] P[2.wav] P[3.wav] P[4.wav] P[5.wav]" etc.

Play Promtp (-Triggering Contact-, chain_audio)

 

Is it supported?

 

Thanks

2 Accepted Solutions

Accepted Solutions

djlundberg
Level 5
Level 5

Hi Valery-

 

If you make your 'chain_audio' variable a type 'Prompt' you can chain together multiple prompts using a plus between them:

chain_audio = P[1.wav] + P[2.wav] + P[3.wav]

 

DJ

 

View solution in original post

No, let's forget Java. What you need is to implement a loop mechanismusing the UCCX provided steps. First of all, take the length of the array, save it to an int variable, let's call it length. Also insert another int variable i (as iterator) for now. Then insert the Create Container Prompt step, with Concatenation type, where the first prompt would be a Prompt type variable, in your case, let's stick with cp, and the next prompt is actaully a string array with the iterator var as the key. The output prompt would be cp as wll. Attach a label named LOOP_START to this step. Next would be a Set variable incrementing the value of i. Next would be an If step testing if the value of i is less or equal than the value of length. If not, then it would hit a Goto step sending the execution back to the step labelled LOOP_START, which is the Create Container step.

 

 

 

 

View solution in original post

10 Replies 10

djlundberg
Level 5
Level 5

Hi Valery-

 

If you make your 'chain_audio' variable a type 'Prompt' you can chain together multiple prompts using a plus between them:

chain_audio = P[1.wav] + P[2.wav] + P[3.wav]

 

DJ

 

Yeah, it's working! Thanks

UPDATE

This solution is only work when you enter prompts by hand for variable in UCCX Script editor.

 

What i'm trying to achieve is to take String variable, like "1.wav,2.wav,3.wav". Parse it. And play chain of files in one Play Prompt step. But Play Prompt step do not recognize String variables.

Is it possible to convert String to Prompt somehow? Maybe there more simple way to fix this?

 

 

Valery,

you can use the Create Container Prompt step (with type Concatenation), like this:

Note that in this example, outPrompt is of type Prompt and prompt is of type String. This step is intelligent enough to add the "as User Prompt" clause.

You can use this step as many times as you want even within a loop, adding new strings (referring to prompts); then finally, playing out the outPrompt in a Play Prompt step.

G.

 

Gergely, thanks for advise. I will try this function.

But i've no idea how to use Create Container Prompt step within a loop to add new prompts.

You can see that i parse a dynamic array, but how to add variable amount of prompts to Create Container ? Could you suggest? thank you.

Hi,

you can use an integer iterator and call the Create Container Prompt step as many times as the number of array members (post-incrementing the value of the iterator).

G.

I'm not sure it is possible to call and fill Create Container within Java code. It is possible to setup variables by hand in Create Container Prompt step, like in Play Prompt step.

Parse a String to Array and fill up Create Container Prompt with Array elements manually. In my example i have only 4 elements, but in real world i could have more than 15 elements.

I wish Play Prompt/Create Container was filled automatically with chain of audio files, because it is impossible to know the array size beforehand.

 

container

 

No, let's forget Java. What you need is to implement a loop mechanismusing the UCCX provided steps. First of all, take the length of the array, save it to an int variable, let's call it length. Also insert another int variable i (as iterator) for now. Then insert the Create Container Prompt step, with Concatenation type, where the first prompt would be a Prompt type variable, in your case, let's stick with cp, and the next prompt is actaully a string array with the iterator var as the key. The output prompt would be cp as wll. Attach a label named LOOP_START to this step. Next would be a Set variable incrementing the value of i. Next would be an If step testing if the value of i is less or equal than the value of length. If not, then it would hit a Goto step sending the execution back to the step labelled LOOP_START, which is the Create Container step.

 

 

 

 

Gergely hanks for help! It is very gentle solution, really cool because no Java code needed.

 

Hi Valery, I'm glad it worked.

G.