Answer the question
In order to leave comments, you need to log in
How to make a personalized voice greeting in Java?
There is a list of the most popular customer names. For each client, there is a unique greeting sound that the IVR must speak.
I have a task to write logic in Java so that by the name of the client, give out the name of the sound.
There are about 200 names, not counting variations of the same name.
The first thing that came to my mind was to use the condition:
if (name.equals("SERGEY") || name.equals("Сергей") || name.equals("Сергiй") )
{
SimplePrompt block=new SimplePrompt("SERGEY_name_xx.wav".replace("xx",language));
}
Answer the question
In order to leave comments, you need to log in
More or less like this:
var userPrompts = Map.of("SERGEY", new SimplePrompt("SERGEY.wav"),
"ANDREW", new SimplePrompt("ANDREW.wav"));
var block = userPrompts.get("SERGEY");
Good afternoon!
Since this option requires writing a large number of lines of code, I'm thinking about how to implement this task.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question