How to use Speech to Text and Smart NPCs

Every installation comes with demo content you can learn from. I will be using those examples here to demonstrate how to use the plugin.

IMPORTANT: Speech data is briefly stored on the cloud and deleted after processing is finished. Usually, this happens within 1-5 seconds.

Using Speech to Text For Dialogue Generation:

  1. Add a audio capture component to the actor or character you want to handle voice processing.

  2. Get the GPT Dialogue Subsystem node and add the Start Mic Capture and Stop Mic Capture node, ensure you add a custom event from the Stop Mic Capture Node. Also ensure you plug in your audio capture component to it for input.

  3. Set the sound submix to SBM_MicroPhone Input so that you do not hear an echo.

  4. Use the Generate Player Input Dialogue Prompt node from the AC_GPTDialogue component.

  5. Plug in the dialogue context you would like to use, you can use any of the different types. in this case I will be using manual dialogue context.

  6. Plug the prompt return value into generate text async. it should look like this when finished:

How to use with Smart NPCs:

  1. To use this with smart NPCs, the logic is similar but slightly different, to start we will keep the start and stop mic capture, however we also need to add a AC_SmartNPC component to both our player character and our NPC Character class.

  2. Now that we have the AC_SmartNPC, on the character we are recording speech or input from, we need to setup the trace details on the component.

  3. Now from the character recording speech, call the "Trace for NPC" node and plug the stop mic callback transcription into the Trace for NPC node.

  1. Now on your NPC you will be talking to, You want to go to the AC_SmartNPC component and create a recieve input event.

  1. This will create a event in your blueprint graph of the NPC, from here you want to use the Generate Player Input Prompt and Generate Text Dialogue Async to have the NPC generate a response.

  1. That is it, your NPC will now respond to whatever you say, you can also use text inputs if you dont want to force mic use in your game. You can go further and generate voice dialogue as well.

  2. Please go over the How to use the dialogue feature in blueprints guide as well as it relates to this feature.

Last updated