How to create NPCs that copy text verbatim(TTS)

Original Discord Post by qqqo_92491 | 2023-12-23 22:45:36

How can I get an NPC to speak back to me the same text I’ve spoken or typed? I’d like to know if there is a way to type any text into a widget and have it output a voice and facial expression accordingly. Is there a way to do TTS like this directly with Blueprint settings?<@&1163218672580575372>

Reply by k3kalinix | 2023-12-23 22:49:55

Hello <@1138879756113293334>, Welcome to Convai Community!
As I understand you are using Unreal Engine, let me tag the <@&1163218672580575372>. They will help you as soon as possible.

Replying to k3kalinix’s Message

Reply by k3kalinix | 2023-12-23 22:49:55
Hello <@1138879756113293334>, Welcome to Convai Community!
As I understand you are using Unreal Engine, let me tag the <@&1163218672580575372>. They will help you as soon as possible.

Reply by qqqo_92491 | 2023-12-23 23:11:17

Thank you.

Reply by freezfast | 2023-12-25 03:14:37

Hi <@1138879756113293334>, you can use the Text To Speech function. However, it would not get any facial expressions/lipsync only audio, please find the docs for it here:

If you would like audio with facial expression and such we recommend using the Invoke Speech function, here is a quick guide on how to use it

You can simply use a trigger message similar to this Please say the following "<Put your text here>" and the character will speak it out

Replying to freezfast’s Message

Reply by freezfast | 2023-12-25 03:14:37
Hi <@1138879756113293334>, you can use the Text To Speech function. However, it would not get any facial expressions/lipsync only audio, please find the docs for it here:
Text To Speech | Documentation

If you would like audio with facial expression and such we recommend using the Invoke Speech function, here is a quick guide on how to use it

You can simply use a trigger message similar to this Please say the following "<Put your text here>" and the character will speak it out

Reply by qqqo_92491 | 2023-12-26 22:41:25

Thank you, is the above operation possible in Korean?

Also, I followed the instructions at Event-Aware Convai Characters | Documentation, but I can’t seem to read the trigger message at all. Is there a complete blueprint I can refer to?

Replying to qqqo_92491’s Message

Reply by qqqo_92491 | 2023-12-26 22:41:25
Thank you, is the above operation possible in Korean?

Also, I followed the instructions at Event-Aware Convai Characters | Documentation, but I can’t seem to read the trigger message at all. Is there a complete blueprint I can refer to?

Reply by freezfast | 2023-12-27 00:17:40

Hi <@1138879756113293334>, what is the trigger message you are sending? we can try to tune it a little

Reply by freezfast | 2023-12-27 00:20:04

Yes it is possible in Korean

Replying to freezfast’s Message

Reply by freezfast | 2023-12-27 00:17:40
Hi <@1138879756113293334>, what is the trigger message you are sending? we can try to tune it a little

Reply by qqqo_92491 | 2023-12-27 13:01:32

I ran it as shown, but I get the error below. What can I do to fix this?

“”"
Blueprint runtime error: “Attempting to read the Chatbot property, accessed None”. Node: Invoke Speech Graph: EventGraph Function: Execute Ubergraph Convai Base Player Blueprint: ConvaiBasePlayer
“”"

Images:

Reply by freezfast | 2023-12-27 14:25:05

The Chatbot variable is none, make sure to use the chatbot component on the character blueprint not the player

Replying to freezfast’s Message

Reply by freezfast | 2023-12-27 14:25:05
The Chatbot variable is none, make sure to use the chatbot component on the character blueprint not the player

Reply by qqqo_92491 | 2024-01-02 00:35:47

I’m not sure what the Chatbot component of the Character Blueprint is, I’ve tried several times and I’m not getting the target set correctly, could you give me a more detailed example or explanation? I’m new to Unreal Engine, so maybe I’m not understanding it well enough.

Replying to qqqo_92491’s Message

Reply by qqqo_92491 | 2024-01-02 00:35:47
I’m not sure what the Chatbot component of the Character Blueprint is, I’ve tried several times and I’m not getting the target set correctly, could you give me a more detailed example or explanation? I’m new to Unreal Engine, so maybe I’m not understanding it well enough.

Reply by freezfast | 2024-01-02 01:07:18

No worries, you can do it like so, basically, get a reference to your character and inside it is the ConvaiChatbotComponent that you want to use, yo ucan of course use a keyboard button to trigger it, or you can use any kind of other logic for example when the player distance from the character is less than x meters or so

Images:

Reply by amapesing | 2024-01-03 23:21:54

have you tried using triggers and the narrative design? I have been using it to generate exact monologues up to 2-3 minutes.

Replying to amapesing’s Message

Reply by amapesing | 2024-01-03 23:21:54
have you tried using triggers and the narrative design? I have been using it to generate exact monologues up to 2-3 minutes.

Reply by freezfast | 2024-01-04 01:53:26

That’s a really good advice as well.
cc: <@808164597050638367> can we get a few steps on setting triggers from narrative design?

Replying to amapesing’s Message

Reply by amapesing | 2024-01-03 23:21:54
have you tried using triggers and the narrative design? I have been using it to generate exact monologues up to 2-3 minutes.

Reply by qqqo_92491 | 2024-01-07 19:13:34

Thank you. I hadn’t thought to modify the trigger message, but thanks for the heads up on how to do that.

This conversation happened on the Convai Discord Server, so this post will be closed.