Setting Speak State

When the Listen state switches to Speak (user sending out text), a speech animation must be generated to respond to user interaction. Make sure the ACE Audio2Face lip-sync, TTS and LLM settings are adjusted in earlier sections:

Import these resources to the nodes in the Behavior Tree with the instruction below.

  1. Remove the Wait Time node created in the Deploying Test Tasks section, as we're going to replace it with speech-related nodes.
  2. Right-click on the empty area and select Leaf > Speech > Speak Gen > Speech Gen - LLM.
  3. A Speech Gen - LLM node is created.


    Select the node to show its corresponding settings in the Parameters section on the right.
  4. Select the prepared resources from the drop-down list for the node to function properly.
  5. Right-click on the empty area and select Leaf > Speech > Speech Player.
  6. A Speech Player node is created to play speech animation generated by LLM.
  7. Connect the Speech Gen - LLM and Speech Player nodes to the Sequencer node in a left to right order.

Add a state node in the Conditional Mechanism to ensure that user typing does not interrupt the character during speech.

  1. Right-click on the empty area and select Leaf > State > Wait All States.
  2. A Wait All States node is created to check whether the current state is running.
  3. Connect the Switch State and Wait All States node to a Sequencer node in a left to right order. Then link the Sequencer node to the Check Speech Request node.
  4. Select the Wait All States node to show its corresponding settings in the Parameters section on the right. Choose the Speak state from the drop-down list and click on Add to the right. This operation blocks the Check Speech Input node interrupting the Speak state when the Check Speech Request node is still running.

    * When the Speak state is finished, the Priority Pick node will restart to detect the child nodes.
  5. After combining the State Machine and Conditional Mechanism with the Starter Setting, you can then chat with the character.