# Extracting some part of conversation in unity

**URL:** <https://forum.convai.com/t/extracting-some-part-of-conversation-in-unity/3300>\
**Category:** Unity SDK\
**Tags:** question, unity\
**Created:** [March 19, 2025, 12:16am UTC](https://forum.convai.com/t/extracting-some-part-of-conversation-in-unity/3300 "2025-03-19T00:16:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arezoo\_Sarshartehran](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/arezoo_sarshartehran/32/2857_2.png) [@Arezoo\_Sarshartehran](https://forum.convai.com/u/Arezoo_Sarshartehran)\
**Post date:** [March 19, 2025, 12:16am UTC](https://forum.convai.com/t/extracting-some-part-of-conversation-in-unity/3300/1 "2025-03-19T00:16:55Z")

</div>

Hi,  
I am looking for a way of extracting some part of the text that NPC provides in real time. What I want to do is trigger an event when the NPC says something specific and extract that part of the text out of the speech bubble and show it on a bigger screen.  
For example, whenever the NPC says “Hello”, I want to write the “Hello” on a bigger screen.  
I know that there are some topics on how to do this in Unreal engine, but I am using Unity.

---

<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:** [March 19, 2025, 12:41am UTC](https://forum.convai.com/t/extracting-some-part-of-conversation-in-unity/3300/2 "2025-03-19T00:41:50Z")

</div>

Hello @Arezoo_Sarshartehran,

**Welcome to the Convai Developer Forum!**

Thank you for clearly describing your use case!

In Unity, you can achieve this by subscribing to the `OnAudioTranscriptAvailable` event from the `ConvaiNPCAudioManager.cs` script. This event provides access to the text transcript that the NPC is speaking.

As an example, you can check the `HandleAudioTranscriptAvailable` method in `ConvaiNPC.cs`. In the `OnEnable()` method, it subscribes to the event like this:

```csharp
AudioManager.OnAudioTranscriptAvailable += HandleAudioTranscriptAvailable;

```

---

<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:** [April 18, 2025, 12:42am UTC](https://forum.convai.com/t/extracting-some-part-of-conversation-in-unity/3300/3 "2025-04-18T00:42:35Z")

</div>

Closed on April 18, 2025, 12:42am UTC

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