Unity - Text In Text Out Only?

Original Discord Post by lt.doge | 2024-09-19 19:16:57

I was wondering if there was a way to configure the NPC in Unity to respond with Text Only. It seems if I turn off/remove the Audio source component, they still move their lips as if audio is playing. How can I circumvent any of this and have a strictly text to text interaction?

Reply by k3kalinix | 2024-09-19 19:24:23

Hello <@260629014962503681> ,

Just disable the audio source component and remove lipsync component.

Reply by lt.doge | 2024-09-19 20:24:12

In the console log I see errors “Can not play a disabled audio source.” I was hoping there was a way to just not use audio entirely and keep it all text. The interaction I’m after is just text to text with as little latency as possible. It seems like it’s still trying to process audio in the background, when I don’t need audio at all. Any way this is possible?

Reply by lt.doge | 2024-09-19 20:25:07

For example, when I use the web browser Character playground, and turn off the avatar’s audio, responses are much quicker and purely text. Can something like this be achieved within the Unity Plugin?

Reply by k3kalinix | 2024-09-19 20:26:42

Yes, but it’s not that easy. You need to remove scripts related to audio processing.

Reply by k3kalinix | 2024-09-19 20:26:59

You have to check ConvaiNPC.cs and ConvaiGRPCAPI.cs

Reply by lt.doge | 2024-09-19 20:30:56

I searched the Discord for this topic, and it appears there was a text-in-text-out scene. Is this no longer the case?

Images:

Reply by k3kalinix | 2024-09-19 20:31:15

It is pretty old post.

Reply by k3kalinix | 2024-09-19 20:31:16

Yes

Reply by lt.doge | 2024-09-19 20:32:03

Thanks. I’ll poke around in the scripts then

Reply by k3kalinix | 2024-09-19 20:35:21

<@260629014962503681>

Reply by k3kalinix | 2024-09-19 20:35:58

Can you update the CreateGetResponseRequest Method by adding AudioConfig = new AudioConfig { DisableAudio = true }?

Images:

Reply by lt.doge | 2024-09-19 20:44:26

hmm, that didn’t work. the NPC no longer responds to voice or text

Reply by k3kalinix | 2024-09-19 20:46:01

<@433610960725344267>

Reply by raghuvanshagarwal | 2024-09-21 09:18:38

One way is to remove the lipsync and then turn the volume of the audio source to zero, the other method is to modify the ConvaiNPCAudioManager and there will be a Coroutine which is responsible for playing the audio, you can modify it such that it doesn’t play the audio and just shows the text

Reply by raghuvanshagarwal | 2024-09-21 09:19:00

Lmk if you are able to do it otherwise I will provide the modified code

Reply by k3kalinix | 2024-09-21 09:19:43

He does not want to receive Audio Data.

Reply by raghuvanshagarwal | 2024-09-21 09:23:13

Yeah but text data comes only with Audio data, so user can modify to not play the audio but just extract the text

Reply by k3kalinix | 2024-09-21 12:50:59

Hello <@260629014962503681>,

Could you please create a new scene?

And add this code.

Attachments:

Replying to raghuvanshagarwal’s Message

Reply by raghuvanshagarwal | 2024-09-21 09:23:13
Yeah but text data comes only with Audio data, so user can modify to not play the audio but just extract the text

Reply by lt.doge | 2024-09-21 15:23:01

You’re telling me that text always comes with the audio data? There’s no way to receive just the text the instance the NPC generates the response?