# Text box to have Convai say whatever i write

**URL:** <https://forum.convai.com/t/text-box-to-have-convai-say-whatever-i-write/2528>\
**Category:** Unity SDK\
**Tags:** question, unity\
**Created:** [January 16, 2025, 8:01am UTC](https://forum.convai.com/t/text-box-to-have-convai-say-whatever-i-write/2528 "2025-01-16T08:01:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dylan\_Suaris](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/dylan_suaris/32/2776_2.png) [@Dylan\_Suaris](https://forum.convai.com/u/Dylan_Suaris)\
**Post date:** [January 16, 2025, 8:01am UTC](https://forum.convai.com/t/text-box-to-have-convai-say-whatever-i-write/2528/1 "2025-01-16T08:01:03Z")

</div>

Hey team!

Im curious to know if there is a way we can have a text inputted and then convai will just say what was written

For example → i have a text box…i enter some text in english. And then hit speak [a button] and then convai needs to just speak it out.

Hoping to hear back from yall!

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [January 16, 2025, 10:40am UTC](https://forum.convai.com/t/text-box-to-have-convai-say-whatever-i-write/2528/2 "2025-01-16T10:40:32Z")

</div>

Hello @Dylan\_Suaris,

You can use the following method from `NarrativeDesignTrigger.cs` to make your Convai character speak a specific line of text. Additionally, you can utilize the `<speak>` tag within the `message` parameter to ensure the text is spoken exactly as written:

```csharp
public void InvokeSpeech(string message)
{
    if (convaiNPC != null && !string.IsNullOrEmpty(message))
    {
        ConvaiNPCManager.Instance.SetActiveConvaiNPC(convaiNPC, false);
        onTriggerEvent?.Invoke();
        convaiNPC.TriggerSpeech(message);
    }
}

```

### Example Usage:

```csharp
InvokeSpeech("<speak> I'll say this exact line! </speak>");

```

### How to Implement:

1. Pass the desired text (including the `<speak>` tag if needed) into the `InvokeSpeech` method.
2. Trigger this method through a button click or other event in your Unity project.

This ensures precise control over what the character says. Let us know if you have further questions! 😊

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex004/uploads/convai/original/1X/e60ef96aa7334c5ccf6682f6c6dbc20fcfa96b49.png) [@system](https://forum.convai.com/u/system)\
**Post date:** [January 18, 2025, 10:40am UTC](https://forum.convai.com/t/text-box-to-have-convai-say-whatever-i-write/2528/3 "2025-01-18T10:40:54Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
