- Home /
How to make multiplayer character say out loud the user input?
Is there a way to program a multiplayer character say out loud user input (a sentence for example) and attach it to the user's character? How do you do it?
Answer by HarshadK · Aug 21, 2017 at 12:05 PM
The exact solution will depend on your specific requirements. But here are a few to give you an idea:
You can have sound files to each user input and play the associated sound file for the input received. This is useful when you have a small set of fixed inputs.
Integrate a Text to Speech service like IBM Watson Text to Speech. The Unity SDK for Watson Developer Cloud Unity SDKServices is available on Github. This is useful when there is no fixed set of inputs or the input set is too large to create sound files for each. This will however require to have internet connectivity and will have latency between receiving input and producing the sound.
Or a combination of these two methods above. Where you can have pre-defined set of inputs with their associated sound files and can get sound for variable inputs as they are received.
If you can provide details of your specific requirements we might be able to suggest a proper solution.
Thanks for your reply!
About my requirements: I need a window where the user can type the message and send it. After that it needs to be printed on the screen which can be seen by other people playing the game and hear the text-to-speech of the input as well. I am new to program$$anonymous$$g so I might not be using the right terms, but this is basically what I want to do.
Since you do not have a specific set of inputs (users can type any message but within the confines of the supported language), you would need to go with option #2 i.e. a text-to-speech service like IB$$anonymous$$ Watson or Amazon Polly to achieve it. Which service to use exactly again depends on various factors like expected output, required languages, costing of service, etc. So it is up to you to choose the proper service.
One more advice is that before you start to research and develop this feature, you should weigh the benefits of having this feature against the resources (time, cost and others) to and overall impact on output to decide whether you should really have this feature in your game.
In addition, do consider if the target users will type out words recognizable by a computer.
eg. afaik, computers cnt rd our shrt hnd nor can they interpret typos.