01-29-2015 08:53 AM - edited 03-14-2019 02:22 PM
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
Solved! Go to Solution.
01-29-2015 11:26 AM
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
02-02-2015 02:27 AM
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.
01-29-2015 11:26 AM
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
01-29-2015 08:46 PM
Yeah, it's working! Thanks
01-30-2015 03:48 AM
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?
01-31-2015 04:19 AM
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.
01-31-2015 09:23 PM
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.
02-01-2015 12:47 PM
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.
02-01-2015 10:18 PM
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.
02-02-2015 02:27 AM
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.
03-19-2015 11:43 PM
Gergely hanks for help! It is very gentle solution, really cool because no Java code needed.
03-20-2015 12:46 AM
Hi Valery, I'm glad it worked.
G.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide